34#define ROCPROFILER_IMPL_HAS_CONCEPT(NAME, TRAIT) \
35 template <typename Tp, typename = typename Tp::TRAIT> \
36 inline constexpr bool NAME(int) \
41 template <typename Tp> \
42 inline constexpr bool NAME(long) \
47#define ROCPROFILER_IMPL_SFINAE_CONCEPT(NAME, ...) \
48 template <typename Tp> \
52 static constexpr auto sfinae(int) -> decltype(__VA_ARGS__, bool()) { return true; } \
54 static constexpr auto sfinae(long) { return false; } \
57 static constexpr bool value = sfinae(0); \
58 constexpr auto operator()() const { return sfinae(0); } \
70 using type = std::remove_cv_t<std::remove_reference_t<std::decay_t<Tp>>>;
76template <
typename Tp,
typename Up>
78: std::is_same<unqualified_identity_t<Tp>, unqualified_identity_t<Up>>
87 static constexpr auto value =
false;
97 static constexpr auto value =
true;
104struct string_support<
std::string_view>
106 using type = std::string_view;
109 static constexpr auto value =
true;
112 type operator()(
const char* val)
const {
return type{val}; }
116struct string_support<
std::string>
118 using type = std::string;
121 static constexpr auto value =
true;
124 type operator()(
const char* val)
const {
return type{val}; }
129template <
typename Tp>
150template <
typename Tp>
179 std::begin(
std::declval<Tp>()),
183template <typename Tp>
186template <typename ArgT>
194 return std::forward<ArgT>(_v).empty();
198 static_assert(std::is_constructible<std::string_view, ArgT>::value,
199 "not string_view constructible");
200 return std::string_view{std::forward<ArgT>(_v)}.empty();
208template <
typename ContainerT,
typename... Args>
211 ->
decltype(_c.emplace_back(std::forward<Args>(_args)...))
213 return _c.emplace_back(std::forward<Args>(_args)...);
216template <
typename ContainerT,
typename... Args>
218emplace(ContainerT& _c,
long, Args&&... _args) ->
decltype(_c.emplace(std::forward<Args>(_args)...))
220 return _c.emplace(std::forward<Args>(_args)...);
223template <
typename ContainerT,
typename ArgT>
225reserve(ContainerT& _c,
int, ArgT _arg) ->
decltype(_c.reserve(_arg), bool())
231template <
typename ContainerT,
typename ArgT>
239template <
typename ContainerT,
typename... Args>
246template <
typename ContainerT,
typename ArgT>
256#undef ROCPROFILER_IMPL_HAS_CONCEPT
257#undef ROCPROFILER_IMPL_SFINAE_CONCEPT
#define ROCPROFILER_IMPL_HAS_CONCEPT(NAME, TRAIT)
#define ROCPROFILER_IMPL_SFINAE_CONCEPT(NAME,...)
auto reserve(ContainerT &_c, int, ArgT _arg) -> decltype(_c.reserve(_arg), bool())
auto emplace(ContainerT &_c, int, Args &&... _args) -> decltype(_c.emplace_back(std::forward< Args >(_args)...))
std::remove_cv_t< std::remove_reference_t< std::decay_t< Tp > > > type
auto emplace(ContainerT &_c, Args &&... _args)
constexpr bool has_value_type(int)
auto reserve(ContainerT &_c, ArgT _arg)
constexpr bool has_mapped_type(int)
typename unqualified_identity< Tp >::type unqualified_identity_t
constexpr bool has_key_type(int)
constexpr bool has_traits(int)
type operator()(const char *val) const
static constexpr type default_value()
static constexpr void default_value()
static constexpr auto value