mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Use enable_if_t
This commit is contained in:
parent
350aaf4b7a
commit
848f1c3d6f
@ -8,7 +8,7 @@
|
||||
#include <map> // for map
|
||||
#include <memory> // for shared_ptr
|
||||
#include <string> // for string
|
||||
#include <type_traits> // for declval, enable_if, false_type, is_co...
|
||||
#include <type_traits> // for declval, enable_if_t, false_type, is_co...
|
||||
#include <typeinfo> // for type_info
|
||||
#include <utility> // for move, swap, pair
|
||||
#include <vector> // for vector
|
||||
@ -39,7 +39,7 @@ namespace ngcore
|
||||
T* constructIfPossible_impl(Rest... /*unused*/)
|
||||
{ throw Exception(std::string(Demangle(typeid(T).name())) + " is not default constructible!"); }
|
||||
|
||||
template<typename T, typename= typename std::enable_if<std::is_constructible<T>::value>::type>
|
||||
template<typename T, typename= std::enable_if_t<std::is_constructible<T>::value>>
|
||||
T* constructIfPossible_impl(int /*unused*/) { return new T; } // NOLINT
|
||||
|
||||
template<typename T>
|
||||
@ -211,7 +211,7 @@ namespace ngcore
|
||||
|
||||
// archive implementation for enums
|
||||
template<typename T>
|
||||
auto operator & (T& val) -> typename std::enable_if<std::is_enum<T>::value, Archive&>::type
|
||||
auto operator & (T& val) -> std::enable_if_t<std::is_enum<T>::value, Archive&>
|
||||
{
|
||||
int enumval;
|
||||
if(Output())
|
||||
@ -274,7 +274,7 @@ namespace ngcore
|
||||
}
|
||||
// Archive arrays =====================================================
|
||||
// this functions can be overloaded in Archive implementations for more efficiency
|
||||
template <typename T, typename = typename std::enable_if<is_archivable<T>>::type>
|
||||
template <typename T, typename = std::enable_if_t<is_archivable<T>>>
|
||||
Archive & Do (T * data, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & data[j]; }; return *this; }; // NOLINT
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace ngcore
|
||||
SymbolTable& operator=(SymbolTable<T>&&) = default;
|
||||
|
||||
template<typename T2=T>
|
||||
auto DoArchive(Archive& ar) -> typename std::enable_if<is_archivable<T2>, void>::type
|
||||
auto DoArchive(Archive& ar) -> typename std::enable_if_t<is_archivable<T2>>
|
||||
{
|
||||
ar & names & data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user