Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
4f71075e
Commit
4f71075e
authored
Aug 26, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect std::set as list-like container
parent
5d4f8645
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+6
-6
No files found.
libcaf_core/caf/detail/type_traits.hpp
View file @
4f71075e
...
...
@@ -53,11 +53,12 @@
class has_##name##_alias { \
private: \
template <class C> \
static std::true_type sfinae(
C* ptr, typename C::name* arg = nullptr);
\
static std::true_type sfinae(
typename C::name*);
\
\
static std::false_type sfinae(void* ptr); \
template <class> \
static std::false_type sfinae(...); \
\
using sfinae_type = decltype(sfinae
(static_cast<T*>(nullptr)));
\
using sfinae_type = decltype(sfinae
<T>(nullptr));
\
\
public: \
static constexpr bool value = sfinae_type::value; \
...
...
@@ -768,7 +769,7 @@ CAF_HAS_ALIAS_TRAIT(mapped_type);
// -- constexpr functions for use in enable_if & friends -----------------------
/// Checks whether T behaves like
a `std::map` or a `std::unordered_
map`.
/// Checks whether T behaves like
`std::
map`.
template
<
class
T
>
struct
is_map_like
{
static
constexpr
bool
value
=
is_iterable
<
T
>::
value
...
...
@@ -776,12 +777,11 @@ struct is_map_like {
&&
has_mapped_type_alias
<
T
>::
value
;
};
/// Checks whether T behaves like
a `std::vector` or a `std::lis
t`.
/// Checks whether T behaves like
`std::vector`, `std::list`, or `std::se
t`.
template
<
class
T
>
struct
is_list_like
{
static
constexpr
bool
value
=
is_iterable
<
T
>::
value
&&
has_value_type_alias
<
T
>::
value
&&
!
has_key_type_alias
<
T
>::
value
&&
!
has_mapped_type_alias
<
T
>::
value
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment