Browse Source

完善_ContainerOfT的概念定义

tags/v2.9.7
tearshark 4 years ago
parent
commit
b1b7e3ade0
2 changed files with 5 additions and 5 deletions
  1. 2
    2
      librf/src/config.h
  2. 3
    3
      librf/src/type_concept.inl

+ 2
- 2
librf/src/config.h View File

#ifndef RESUMEF_ENABLE_CONCEPT #ifndef RESUMEF_ENABLE_CONCEPT
#ifdef __cpp_lib_concepts #ifdef __cpp_lib_concepts
/* #undef RESUMEF_ENABLE_CONCEPT */
#define RESUMEF_ENABLE_CONCEPT 1
#else #else
/* #undef RESUMEF_ENABLE_CONCEPT */
#define RESUMEF_ENABLE_CONCEPT 1
#endif //#ifdef __cpp_lib_concepts #endif //#ifdef __cpp_lib_concepts
#endif //#ifndef RESUMEF_ENABLE_CONCEPT #endif //#ifndef RESUMEF_ENABLE_CONCEPT

+ 3
- 3
librf/src/type_concept.inl View File

}; };
template<typename T, typename E> template<typename T, typename E>
concept _IteratorOfT = _IteratorT<T> && requires(T && u)
concept _IteratorOfT = _IteratorT<T> && requires(T&& u)
{ {
{ *u } ->std::same_as<E&>; { *u } ->std::same_as<E&>;
}; };
}; };
template<typename T, typename E> template<typename T, typename E>
concept _ContainerOfT = _ContainerT<T> && requires(T && u)
concept _ContainerOfT = _ContainerT<T> && requires(T&& v)
{ {
{ *std::begin(u) } ->std::same_as<E&>;
requires std::is_same_v<E, remove_cvref_t<decltype(*std::begin(v))>>;
}; };
#define COMMA_RESUMEF_ENABLE_IF_TYPENAME() #define COMMA_RESUMEF_ENABLE_IF_TYPENAME()

Loading…
Cancel
Save