diff --git a/packages/belos/src/BelosPCPGSolMgr.hpp b/packages/belos/src/BelosPCPGSolMgr.hpp index 3d6382435062..a09a26f21398 100644 --- a/packages/belos/src/BelosPCPGSolMgr.hpp +++ b/packages/belos/src/BelosPCPGSolMgr.hpp @@ -66,7 +66,6 @@ #if defined(HAVE_TEUCHOSCORE_CXX11) # include #endif // defined(HAVE_TEUCHOSCORE_CXX11) -#include "Teuchos_TypeTraits.hpp" namespace Belos { diff --git a/packages/stratimikos/adapters/amesos2/src/Thyra_Amesos2LinearOpWithSolveFactory_def.hpp b/packages/stratimikos/adapters/amesos2/src/Thyra_Amesos2LinearOpWithSolveFactory_def.hpp index 1c359334d818..eca064aed7c7 100644 --- a/packages/stratimikos/adapters/amesos2/src/Thyra_Amesos2LinearOpWithSolveFactory_def.hpp +++ b/packages/stratimikos/adapters/amesos2/src/Thyra_Amesos2LinearOpWithSolveFactory_def.hpp @@ -57,7 +57,6 @@ #include "Teuchos_dyn_cast.hpp" #include "Teuchos_TimeMonitor.hpp" #include "Teuchos_TypeNameTraits.hpp" -#include "Teuchos_TypeTraits.hpp" #include "Teuchos_VerboseObjectParameterListHelpers.hpp" namespace Thyra { diff --git a/packages/stratimikos/adapters/belos/src/Thyra_BelosLinearOpWithSolve_def.hpp b/packages/stratimikos/adapters/belos/src/Thyra_BelosLinearOpWithSolve_def.hpp index c6cf609e15ba..9a83a32afb45 100644 --- a/packages/stratimikos/adapters/belos/src/Thyra_BelosLinearOpWithSolve_def.hpp +++ b/packages/stratimikos/adapters/belos/src/Thyra_BelosLinearOpWithSolve_def.hpp @@ -51,7 +51,6 @@ #include "Teuchos_DebugDefaultAsserts.hpp" #include "Teuchos_Assert.hpp" #include "Teuchos_TimeMonitor.hpp" -#include "Teuchos_TypeTraits.hpp" #include "Stratimikos_Config.h" #ifdef HAVE_STRATIMIKOS_THYRATPETRAADAPTERS # include "Thyra_TpetraThyraWrappers.hpp" @@ -207,7 +206,7 @@ void BelosLinearOpWithSolve::initialize( defaultTol_ = as (solverPL_->get ("Convergence Tolerance")); } - else if (Teuchos::TypeTraits::is_same::value) { + else if (std::is_same_v) { // magnitude_type == double in this case, and we've already // checked double above. TEUCHOS_TEST_FOR_EXCEPTION( @@ -257,7 +256,7 @@ void BelosLinearOpWithSolve::initialize( defaultTol_ = as (defaultPL->get ("Convergence Tolerance")); } - else if (Teuchos::TypeTraits::is_same::value) { + else if (std::is_same_v) { // magnitude_type == double in this case, and we've already // checked double above. TEUCHOS_TEST_FOR_EXCEPTION( diff --git a/packages/teuchos/core/src/Teuchos_TypeTraits.hpp b/packages/teuchos/core/src/Teuchos_TypeTraits.hpp deleted file mode 100644 index 5b7181457e3c..000000000000 --- a/packages/teuchos/core/src/Teuchos_TypeTraits.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// @HEADER -// *********************************************************************** -// -// Teuchos: Common Tools Package -// Copyright (2004) Sandia Corporation -// -// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive -// license for use of this work by or on behalf of the U.S. Government. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Michael A. Heroux (maherou@sandia.gov) -// -// *********************************************************************** -// @HEADER - -#ifndef _TEUCHOS_TYPE_TRAITS_HPP_ -#define _TEUCHOS_TYPE_TRAITS_HPP_ - -/*! \file Teuchos_TypeTraits.hpp - \brief Defines basic traits allowing evaluation of type equality. -*/ - -namespace Teuchos { - -namespace TypeTraits { - -/** \brief Default is_equal traits class has \c value equal to \c false, indicating that T1 and T2 are not equal, - * - * \ingroup teuchos_language_support_grp - */ -template -struct is_same { - enum {value = false}; -}; - -/** \brief Partial specialization of is_equal class for equal types, where \c value equal to \c true. - * - * \ingroup teuchos_language_support_grp - */ -template -struct is_same { - enum {value = true}; -}; - -} - -} // namespace Teuchos - - -#endif // _TEUCHOS_TYPE_TRAITS_HPP_ - diff --git a/packages/teuchos/core/test/ScalarTraits/ScalarTraits_test.cpp b/packages/teuchos/core/test/ScalarTraits/ScalarTraits_test.cpp index d8889ff16ef2..e78f956b3624 100644 --- a/packages/teuchos/core/test/ScalarTraits/ScalarTraits_test.cpp +++ b/packages/teuchos/core/test/ScalarTraits/ScalarTraits_test.cpp @@ -46,7 +46,6 @@ #include "Teuchos_CommandLineProcessor.hpp" #include "Teuchos_VerboseObject.hpp" #include "Teuchos_StandardCatchMacros.hpp" -#include "Teuchos_TypeTraits.hpp" #include "Teuchos_Version.hpp" #include "Teuchos_TestingHelpers.hpp" @@ -81,13 +80,12 @@ int outputOrdinal(const char& t) template void TYPE_CHAIN_A(Teuchos::FancyOStream &out) { - using Teuchos::TypeTraits::is_same; typedef typename Teuchos::ScalarTraits::doublePrecision double_type; T b; // double_type d; // unused out << Teuchos::typeName (b); - if (! is_same::value) { + if (! std::is_same_v) { out << " -> "; TYPE_CHAIN_A(out); } @@ -95,14 +93,13 @@ void TYPE_CHAIN_A(Teuchos::FancyOStream &out) { template void TYPE_CHAIN_D(Teuchos::FancyOStream &out) { - using Teuchos::TypeTraits::is_same; typedef typename Teuchos::ScalarTraits::halfPrecision half_type; T b; // half_type d; // unused out << Teuchos::typeName (b); - if (! is_same::value) { + if (! std::is_same_v) { out << " -> "; TYPE_CHAIN_D(out); } diff --git a/packages/xpetra/test/MultiVector/MultiVector_UnitTests.cpp b/packages/xpetra/test/MultiVector/MultiVector_UnitTests.cpp index af3b9728a35c..686ba83b4ac3 100644 --- a/packages/xpetra/test/MultiVector/MultiVector_UnitTests.cpp +++ b/packages/xpetra/test/MultiVector/MultiVector_UnitTests.cpp @@ -51,7 +51,6 @@ #include #include #include -#include #include #include @@ -102,7 +101,6 @@ namespace { using std::ostream_iterator; using std::string; - using Teuchos::TypeTraits::is_same; using Teuchos::RCP; using Teuchos::ArrayRCP; using Teuchos::rcp; @@ -540,10 +538,10 @@ namespace { // Norms are not computed by Epetra_IntMultiVector so far #ifdef HAVE_XPETRA_EPETRA - if(!is_same::value) + if(!std::is_same_v) #endif { - if(!(is_same::value || is_same::value)) { + if(!(std::is_same_v || std::is_same_v)) { out << "Running the norm tests!" << std::endl; // we zeroed it out in the constructor; all norms should be zero Array norms(numVecs), zeros(numVecs); @@ -572,7 +570,7 @@ namespace { ArrayRCP replaceGlobalData = mvec.getData(5); ArrayRCP sumIntoGlobalData = mvec.getData(6); - if(is_same::value || is_same::value) { + if(std::is_same_v || std::is_same_v) { TEST_EQUALITY( replaceLocalData[testLID], testValue ); TEST_EQUALITY( sumIntoLocalData[testLID], testValue + sumValue ); TEST_EQUALITY( replaceGlobalData[testLID], testValue ); @@ -2532,10 +2530,10 @@ namespace { typedef typename MV::local_ordinal_type local_ordinal_type; typedef typename MV::global_ordinal_type global_ordinal_type; typedef typename MV::node_type node_type; - TEST_EQUALITY_CONST( (is_same< scalar_type , Scalar >::value) == true, true ); - TEST_EQUALITY_CONST( (is_same< local_ordinal_type , LocalOrdinal >::value) == true, true ); - TEST_EQUALITY_CONST( (is_same< global_ordinal_type , GlobalOrdinal >::value) == true, true ); - TEST_EQUALITY_CONST( (is_same< node_type , Node >::value) == true, true ); + TEST_EQUALITY_CONST( (std::is_same_v< scalar_type , Scalar >) == true, true ); + TEST_EQUALITY_CONST( (std::is_same_v< local_ordinal_type , LocalOrdinal >) == true, true ); + TEST_EQUALITY_CONST( (std::is_same_v< global_ordinal_type , GlobalOrdinal >) == true, true ); + TEST_EQUALITY_CONST( (std::is_same_v< node_type , Node >) == true, true ); #endif } diff --git a/packages/xpetra/test/MultiVector/MultiVector_UnitTestsThyraSpecific.cpp b/packages/xpetra/test/MultiVector/MultiVector_UnitTestsThyraSpecific.cpp index 7e4be633f94f..34f356b0635a 100644 --- a/packages/xpetra/test/MultiVector/MultiVector_UnitTestsThyraSpecific.cpp +++ b/packages/xpetra/test/MultiVector/MultiVector_UnitTestsThyraSpecific.cpp @@ -44,7 +44,6 @@ // // @HEADER #include -#include #include #include