better to_string test
This commit is contained in:
parent
2c09fc968f
commit
5f083f2b67
|
@ -479,15 +479,16 @@ AnyString<A> concat(std::initializer_list<T> v, const S &sep = " ") {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct ToStringTest {
|
auto test_tostring(int) ->
|
||||||
template<typename U, String (U::*)() const> struct Test {};
|
decltype(IsSame<decltype(declval<T>().to_string()), String>());
|
||||||
template<typename U> static char test(Test<U, &U::to_string> *);
|
template<typename>
|
||||||
template<typename U> static int test(...);
|
False test_tostring(...);
|
||||||
static constexpr bool value = (sizeof(test<T>(0)) == sizeof(char));
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static True test_iterable(decltype(octa::iter(declval<T>())) *);
|
using ToStringTest = decltype(test_tostring<T>(0));
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
True test_iterable(decltype(octa::iter(declval<T>())) *);
|
||||||
template<typename> static False test_iterable(...);
|
template<typename> static False test_iterable(...);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
Loading…
Reference in a new issue