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

@@ -14,9 +14,9 @@
#ifndef RESUMEF_ENABLE_CONCEPT
#ifdef __cpp_lib_concepts
/* #undef RESUMEF_ENABLE_CONCEPT */
#define RESUMEF_ENABLE_CONCEPT 1
#else
/* #undef RESUMEF_ENABLE_CONCEPT */
#define RESUMEF_ENABLE_CONCEPT 1
#endif //#ifdef __cpp_lib_concepts
#endif //#ifndef RESUMEF_ENABLE_CONCEPT

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

@@ -59,7 +59,7 @@ namespace resumef
};
template<typename T, typename E>
concept _IteratorOfT = _IteratorT<T> && requires(T && u)
concept _IteratorOfT = _IteratorT<T> && requires(T&& u)
{
{ *u } ->std::same_as<E&>;
};
@@ -79,9 +79,9 @@ namespace resumef
};
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()

Loading…
Cancel
Save