cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::traits::has_toString< T > Struct Template Reference

检查类型是否有toString方法(C++17之前版本)/Check if type has toString method (pre-C++17 version) More...

#include <type_traits.hpp>

Static Public Attributes

static constexpr bool value = decltype(test<T>(0))::value
 

Detailed Description

template<typename T>
struct toolbox::traits::has_toString< T >

检查类型是否有toString方法(C++17之前版本)/Check if type has toString method (pre-C++17 version)

Template Parameters
T要检查的类型/Type to check
struct WithToString {
std::string toString() { return "hello"; }
};
struct WithoutToString {};
static constexpr bool value
Definition type_traits.hpp:200

Member Data Documentation

◆ value

template<typename T >
constexpr bool toolbox::traits::has_toString< T >::value = decltype(test<T>(0))::value
staticconstexpr

The documentation for this struct was generated from the following file: