mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 05:30:46 +01:00
Revert "Add function to return full type as std::string"
This reverts commit 1cb745c8dcdf1099e2c9b693e87f851f8cf0d845.
This commit is contained in:
parent
58c30c0cb1
commit
74f79c5ac7
@ -23,7 +23,6 @@ Author: Christopher Kelly <ckelly@phys.columbia.edu>
|
|||||||
#define GRID_MATH_TRAITS_H
|
#define GRID_MATH_TRAITS_H
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cxxabi.h>
|
|
||||||
|
|
||||||
namespace Grid {
|
namespace Grid {
|
||||||
|
|
||||||
@ -289,25 +288,6 @@ namespace Grid {
|
|||||||
|
|
||||||
enum { value = sizeof(real_scalar_type)/sizeof(float) };
|
enum { value = sizeof(real_scalar_type)/sizeof(float) };
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> std::string getTypename() {
|
|
||||||
|
|
||||||
typedef typename std::remove_reference<T>::type TWoRef;
|
|
||||||
|
|
||||||
std::unique_ptr<char, void (*)(void *)> own(abi::__cxa_demangle(typeid(TWoRef).name(), nullptr, nullptr, nullptr), std::free);
|
|
||||||
|
|
||||||
std::string r = own != nullptr ? own.get() : typeid(TWoRef).name();
|
|
||||||
|
|
||||||
if(std::is_const<TWoRef>::value)
|
|
||||||
r += " const";
|
|
||||||
if(std::is_volatile<TWoRef>::value)
|
|
||||||
r += " volatile";
|
|
||||||
if(std::is_lvalue_reference<T>::value)
|
|
||||||
r += "&";
|
|
||||||
else if(std::is_rvalue_reference<T>::value)
|
|
||||||
r += "&&";
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user