Skip to content

Commit

Permalink
teuchos(cleaning): remove old type traits is_same
Browse files Browse the repository at this point in the history
  • Loading branch information
uliegecsm committed Sep 7, 2023
1 parent b59db72 commit 0808009
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 97 deletions.
1 change: 0 additions & 1 deletion packages/belos/src/BelosPCPGSolMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
#if defined(HAVE_TEUCHOSCORE_CXX11)
# include <type_traits>
#endif // defined(HAVE_TEUCHOSCORE_CXX11)
#include "Teuchos_TypeTraits.hpp"

namespace Belos {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -207,7 +206,7 @@ void BelosLinearOpWithSolve<Scalar>::initialize(
defaultTol_ =
as<magnitude_type> (solverPL_->get<double> ("Convergence Tolerance"));
}
else if (Teuchos::TypeTraits::is_same<double, magnitude_type>::value) {
else if (std::is_same_v<double, magnitude_type>) {
// magnitude_type == double in this case, and we've already
// checked double above.
TEUCHOS_TEST_FOR_EXCEPTION(
Expand Down Expand Up @@ -257,7 +256,7 @@ void BelosLinearOpWithSolve<Scalar>::initialize(
defaultTol_ =
as<magnitude_type> (defaultPL->get<double> ("Convergence Tolerance"));
}
else if (Teuchos::TypeTraits::is_same<double, magnitude_type>::value) {
else if (std::is_same_v<double, magnitude_type>) {
// magnitude_type == double in this case, and we've already
// checked double above.
TEUCHOS_TEST_FOR_EXCEPTION(
Expand Down
77 changes: 0 additions & 77 deletions packages/teuchos/core/src/Teuchos_TypeTraits.hpp

This file was deleted.

7 changes: 2 additions & 5 deletions packages/teuchos/core/test/ScalarTraits/ScalarTraits_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -81,28 +80,26 @@ int outputOrdinal(const char& t)

template <class T>
void TYPE_CHAIN_A(Teuchos::FancyOStream &out) {
using Teuchos::TypeTraits::is_same;
typedef typename Teuchos::ScalarTraits<T>::doublePrecision double_type;

T b;
// double_type d; // unused
out << Teuchos::typeName (b);
if (! is_same<T, double_type>::value) {
if (! std::is_same_v<T, double_type>) {
out << " -> ";
TYPE_CHAIN_A<double_type>(out);
}
}

template <class T>
void TYPE_CHAIN_D(Teuchos::FancyOStream &out) {
using Teuchos::TypeTraits::is_same;
typedef typename Teuchos::ScalarTraits<T>::halfPrecision half_type;

T b;
// half_type d; // unused
out << Teuchos::typeName (b);

if (! is_same<T, half_type>::value) {
if (! std::is_same_v<T, half_type>) {
out << " -> ";
TYPE_CHAIN_D<half_type>(out);
}
Expand Down
16 changes: 7 additions & 9 deletions packages/xpetra/test/MultiVector/MultiVector_UnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include <Teuchos_Tuple.hpp>
#include <Teuchos_ScalarTraits.hpp>
#include <Teuchos_OrdinalTraits.hpp>
#include <Teuchos_TypeTraits.hpp>
#include <Teuchos_Comm.hpp>
#include <Teuchos_Range1D.hpp>

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -540,10 +538,10 @@ namespace {

// Norms are not computed by Epetra_IntMultiVector so far
#ifdef HAVE_XPETRA_EPETRA
if(!is_same<typename MV::node_type, Xpetra::EpetraNode>::value)
if(!std::is_same_v<typename MV::node_type, Xpetra::EpetraNode>)
#endif
{
if(!(is_same<typename MV::scalar_type, int>::value || is_same<typename MV::scalar_type, long long int>::value)) {
if(!(std::is_same_v<typename MV::scalar_type, int> || std::is_same_v<typename MV::scalar_type, long long int>)) {
out << "Running the norm tests!" << std::endl;
// we zeroed it out in the constructor; all norms should be zero
Array<Magnitude> norms(numVecs), zeros(numVecs);
Expand Down Expand Up @@ -572,7 +570,7 @@ namespace {
ArrayRCP<const Scalar> replaceGlobalData = mvec.getData(5);
ArrayRCP<const Scalar> sumIntoGlobalData = mvec.getData(6);

if(is_same<typename MV::scalar_type, int>::value || is_same<typename MV::scalar_type, long long int>::value) {
if(std::is_same_v<typename MV::scalar_type, int> || std::is_same_v<typename MV::scalar_type, long long int>) {
TEST_EQUALITY( replaceLocalData[testLID], testValue );
TEST_EQUALITY( sumIntoLocalData[testLID], testValue + sumValue );
TEST_EQUALITY( replaceGlobalData[testLID], testValue );
Expand Down Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
//
// @HEADER
#include <Teuchos_UnitTestHarness.hpp>
#include <Teuchos_TypeTraits.hpp>
#include <Xpetra_UnitTestHelpers.hpp>
#include <Teuchos_Comm.hpp>

Expand Down

0 comments on commit 0808009

Please sign in to comment.