Skip to content

Commit dd0c8f0

Browse files
Merge pull request #1214 from sstsimulator/devel
Automatically Merged using SST Master Branch Merger
2 parents 9b10c25 + 319c45c commit dd0c8f0

File tree

11 files changed

+32
-39
lines changed

11 files changed

+32
-39
lines changed

src/sst/core/eli/attributeInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace SST {
2222
namespace ELI {
2323

24-
template <class T, class Enable = void>
24+
template <typename, typename = void>
2525
struct GetAttributes
2626
{
2727
static const std::vector<SST::ElementInfoAttribute>& get()
@@ -31,8 +31,8 @@ struct GetAttributes
3131
}
3232
};
3333

34-
template <class T>
35-
struct GetAttributes<T, typename MethodDetect<decltype(T::ELI_getAttributes())>::type>
34+
template <typename T>
35+
struct GetAttributes<T, std::void_t<decltype(T::ELI_getAttributes())>>
3636
{
3737
static const std::vector<SST::ElementInfoAttribute>& get() { return T::ELI_getAttributes(); }
3838
};

src/sst/core/eli/elementinfo.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "sst/core/eli/elibase.h"
1717

18-
#include <sstream>
18+
#include <ostream>
1919
#include <string>
2020
#include <vector>
2121

@@ -35,16 +35,14 @@ static const std::vector<int> SST_ELI_COMPILED_VERSION = { 0, 9, 0 };
3535
std::string
3636
ProvidesDefaultInfo::getELIVersionString() const
3737
{
38-
std::stringstream stream;
39-
bool first = true;
40-
for ( int item : SST_ELI_COMPILED_VERSION ) {
41-
if ( first )
42-
first = false;
43-
else
44-
stream << ".";
45-
stream << item;
38+
std::string str;
39+
const char* delim = "";
40+
for ( auto item : SST_ELI_COMPILED_VERSION ) {
41+
str += delim;
42+
delim = ".";
43+
str += std::to_string(item);
4644
}
47-
return stream.str();
45+
return str;
4846
}
4947

5048
const std::vector<int>&

src/sst/core/eli/elibase.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ namespace ELI {
2222

2323
std::unique_ptr<LoadedLibraries::LibraryMap> LoadedLibraries::loaders_ {};
2424

25-
static const std::vector<int> SST_ELI_COMPILED_VERSION = { 0, 9, 0 };
26-
2725
bool
2826
LoadedLibraries::addLoader(
2927
const std::string& lib, const std::string& name, const std::string& alias, LibraryLoader* loader)

src/sst/core/eli/elibase.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <memory>
2222
#include <set>
2323
#include <string>
24+
#include <type_traits>
2425
#include <vector>
2526

2627
// Component Category Definitions
@@ -125,12 +126,6 @@ combineEliInfo(std::vector<T>& base, std::vector<T>& add)
125126
// field
126127
void combineEliInfo(std::vector<ElementInfoAttribute>& base, std::vector<ElementInfoAttribute>& add);
127128

128-
template <class T>
129-
struct MethodDetect
130-
{
131-
using type = void;
132-
};
133-
134129
struct LibraryLoader
135130
{
136131
virtual void load() = 0;
@@ -159,14 +154,14 @@ class LoadedLibraries
159154

160155
// Template used to get aliases. Needed because the ELI_getAlias()
161156
// function may not exist.
162-
template <class T, class Enable = void>
157+
template <typename, typename = void>
163158
struct GetAlias
164159
{
165160
static std::string get() { return ""; }
166161
};
167162

168-
template <class T>
169-
struct GetAlias<T, typename MethodDetect<decltype(T::ELI_getAlias())>::type>
163+
template <typename T>
164+
struct GetAlias<T, std::void_t<decltype(T::ELI_getAlias())>>
170165
{
171166
static std::string get() { return T::ELI_getAlias(); }
172167
};

src/sst/core/eli/paramsInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace SST {
2121
namespace ELI {
2222

23-
template <class T, class Enable = void>
23+
template <typename, typename = void>
2424
struct GetParams
2525
{
2626
static const std::vector<SST::ElementInfoParam>& get()
@@ -31,7 +31,7 @@ struct GetParams
3131
};
3232

3333
template <class T>
34-
struct GetParams<T, typename MethodDetect<decltype(T::ELI_getParams())>::type>
34+
struct GetParams<T, std::void_t<decltype(T::ELI_getParams())>>
3535
{
3636
static const std::vector<SST::ElementInfoParam>& get() { return T::ELI_getParams(); }
3737
};

src/sst/core/eli/portsInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace SST {
2121
namespace ELI {
2222

23-
template <class T, class Enable = void>
23+
template <typename, typename = void>
2424
struct InfoPorts
2525
{
2626
static const std::vector<SST::ElementInfoPort>& get()
@@ -30,8 +30,8 @@ struct InfoPorts
3030
}
3131
};
3232

33-
template <class T>
34-
struct InfoPorts<T, typename MethodDetect<decltype(T::ELI_getPorts())>::type>
33+
template <typename T>
34+
struct InfoPorts<T, std::void_t<decltype(T::ELI_getPorts())>>
3535
{
3636
static const std::vector<SST::ElementInfoPort>& get() { return T::ELI_getPorts(); }
3737
};

src/sst/core/eli/profilePointInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace SST {
2121
namespace ELI {
2222

23-
template <class T, class Enable = void>
23+
template <typename, typename = void>
2424
struct InfoProfilePoints
2525
{
2626
static const std::vector<SST::ElementInfoProfilePoint>& get()
@@ -31,7 +31,7 @@ struct InfoProfilePoints
3131
};
3232

3333
template <class T>
34-
struct InfoProfilePoints<T, typename MethodDetect<decltype(T::ELI_getProfilePoints())>::type>
34+
struct InfoProfilePoints<T, std::void_t<decltype(T::ELI_getProfilePoints())>>
3535
{
3636
static const std::vector<SST::ElementInfoProfilePoint>& get() { return T::ELI_getProfilePoints(); }
3737
};

src/sst/core/eli/simpleInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ template <int num, typename InfoType>
2828
struct SimpleInfoPlaceHolder
2929
{};
3030

31-
// Class to check for an ELI_getSimpleInfo Function. The
32-
// MethodDetect way to detect a member function doesn't seem to work
33-
// for functions with specific type signatures and we need to
31+
// Class to check for an ELI_getSimpleInfo Function. The std::void_t<
32+
// decltype()> way to detect a member function's type doesn't seem to
33+
// work for functions with specific type signatures and we need to
3434
// differentiate between the various versions using the first
3535
// parameter to the function (index + type).
3636
template <class T, int index, class InfoType>

src/sst/core/eli/statsInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace SST {
2121
namespace ELI {
2222

23-
template <class T, class Enable = void>
23+
template <typename, typename = void>
2424
struct InfoStats
2525
{
2626
static const std::vector<SST::ElementInfoStatistic>& get()
@@ -30,8 +30,8 @@ struct InfoStats
3030
}
3131
};
3232

33-
template <class T>
34-
struct InfoStats<T, typename MethodDetect<decltype(T::ELI_getStatistics())>::type>
33+
template <typename T>
34+
struct InfoStats<T, std::void_t<decltype(T::ELI_getStatistics())>>
3535
{
3636
static const std::vector<SST::ElementInfoStatistic>& get() { return T::ELI_getStatistics(); }
3737
};

src/sst/core/eli/subcompSlotInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace SST {
2121
namespace ELI {
2222

23-
template <class T, class Enable = void>
23+
template <typename, typename = void>
2424
struct InfoSubs
2525
{
2626
static const std::vector<SST::ElementInfoSubComponentSlot>& get()
@@ -31,7 +31,7 @@ struct InfoSubs
3131
};
3232

3333
template <class T>
34-
struct InfoSubs<T, typename MethodDetect<decltype(T::ELI_getSubComponentSlots())>::type>
34+
struct InfoSubs<T, std::void_t<decltype(T::ELI_getSubComponentSlots())>>
3535
{
3636
static const std::vector<SST::ElementInfoSubComponentSlot>& get() { return T::ELI_getSubComponentSlots(); }
3737
};

0 commit comments

Comments
 (0)