Skip to content

Commit 40a8c04

Browse files
committed
Merge remote-tracking branch 'sstcore/devel' into combineEliInfo
2 parents 7089e18 + 319c45c commit 40a8c04

File tree

11 files changed

+31
-39
lines changed

11 files changed

+31
-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: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ combineEliInfo(std::vector<T>& base, const std::vector<T>& add)
122122
base.swap(combined);
123123
}
124124

125-
template <class T>
126-
struct MethodDetect
127-
{
128-
using type = void;
129-
};
130-
131125
struct LibraryLoader
132126
{
133127
virtual void load() = 0;
@@ -156,14 +150,14 @@ class LoadedLibraries
156150

157151
// Template used to get aliases. Needed because the ELI_getAlias()
158152
// function may not exist.
159-
template <class T, class Enable = void>
153+
template <typename, typename = void>
160154
struct GetAlias
161155
{
162156
static std::string get() { return ""; }
163157
};
164158

165-
template <class T>
166-
struct GetAlias<T, typename MethodDetect<decltype(T::ELI_getAlias())>::type>
159+
template <typename T>
160+
struct GetAlias<T, std::void_t<decltype(T::ELI_getAlias())>>
167161
{
168162
static std::string get() { return T::ELI_getAlias(); }
169163
};

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)