Hedgehog  0.0.0
A library to generate hybrid pipeline workflow systems
hh::StaticMemoryManager< ManagedMemory, Args >::HasConstructor Class Reference

SFINAE construct to test if ManagedMemory has a constructor with Args... as parameter. More...

Collaboration diagram for hh::StaticMemoryManager< ManagedMemory, Args >::HasConstructor:
Collaboration graph

Public Types

enum  { value = std::is_same_v<decltype(test<ManagedMemory, Args...>(0)), std::true_type> }
 Enum to get statically the result of the test.
 

Static Private Member Functions

template<class TestManagedMemory , class... TestArgs>
static std::true_type test (decltype(new TestManagedMemory((std::declval< TestArgs >())...)))
 True test, testing if a constructor with the right parameters exist and can be called. More...
 
template<class TestManagedMemory , class ... TestArgs>
static std::false_type test (...)
 False test, default test in case the searched constructor does not exist, without instantiating anything. More...
 

Detailed Description

template<class ManagedMemory, class... Args>
class hh::StaticMemoryManager< ManagedMemory, Args >::HasConstructor

SFINAE construct to test if ManagedMemory has a constructor with Args... as parameter.

https://en.cppreference.com/w/cpp/language/sfinae

Definition at line 88 of file static_memory_manager.h.

Member Function Documentation

◆ test() [1/2]

template<class ManagedMemory, class... Args>
template<class TestManagedMemory , class... TestArgs>
static std::true_type hh::StaticMemoryManager< ManagedMemory, Args >::HasConstructor::test ( decltype(new TestManagedMemory((std::declval< TestArgs >())...))  )
staticprivate

True test, testing if a constructor with the right parameters exist and can be called.

Template Parameters
TestManagedMemoryType of data to test
TestArgsType of constructor's parameters
Returns
std::true_type

◆ test() [2/2]

template<class ManagedMemory, class... Args>
template<class TestManagedMemory , class ... TestArgs>
static std::false_type hh::StaticMemoryManager< ManagedMemory, Args >::HasConstructor::test (   ...)
staticprivate

False test, default test in case the searched constructor does not exist, without instantiating anything.

Template Parameters
TestManagedMemoryType of data to test
TestArgsType of constructor's parameters
Returns
std::false_type

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