Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_XMLInputStream.cpp
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
11 #include "Teuchos_Assert.hpp"
12 
13 using namespace Teuchos;
14 
15 
16 unsigned int XMLInputStream::curPos() const
17 {
18  // NOTE (mfh 15 Sep 2014): Most compilers have figured out that the
19  // return statement below is unreachable. Some older compilers
20  // might not realize this. That's why the return statement was put
21  // there, so that those compilers don't warn that this function
22  // doesn't return a value. If it's a choice between one warning and
23  // another, I would prefer the choice that produces less code and
24  // doesn't have unreachable code (which never gets tested).
25 
26  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
27  "XMLInputStream::curPos() should never be called. It exists only for "
28  "compatibility with Xerces.");
29  // return 0; // unreachable
30 }
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
A base class for defining a XML input stream.
virtual unsigned int curPos() const
Identify current position.