BRICKS
Small, useful blocks of code, to build bigger things.
Loading...
Searching...
No Matches
bricks::has_find< T, U > Struct Template Reference

Checks if a type has a find method taking a specific type. More...

#include <type_traits.hpp>

Related Symbols

(Note that these are not member symbols.)

template<class T , typename U >
constexpr bool has_find_v = has_find<T, U>::value
 Helper variable template to check if a type has a find method taking a specific type.
 

Detailed Description

template<typename T, typename U>
struct bricks::has_find< T, U >

Checks if a type has a find method taking a specific type.

Provides the member constant value which is true if the type has a find method taking a specific type, otherwise value is equal to false.

Template Parameters
TThe type to check.
UThe type of the argument to find.

Friends And Related Symbol Documentation

◆ has_find_v

template<typename T , typename U >
template<class T , typename U >
bool has_find_v = has_find<T, U>::value
related

Helper variable template to check if a type has a find method taking a specific type.

Example:

struct foo {
[[nodiscard]] auto find(int /* unused */) const -> int { return 0; };
};
struct bar {
[[nodiscard]] auto find(int /* unused */) -> int { return 0; };
};
struct baz {};
static_assert(bricks::has_find_v<foo, int>);
static_assert(bricks::has_find_v<bar, int>);
static_assert(!bricks::has_find_v<baz, int>);

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