mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
sprout/utility/enabler_if.hpp 追加
This commit is contained in:
parent
e11da4400b
commit
86073fea83
3 changed files with 31 additions and 23 deletions
23
sprout/utility/enabler_if.hpp
Normal file
23
sprout/utility/enabler_if.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef SPROUT_UTILITY_ENABLER_IF_HPP
|
||||
#define SPROUT_UTILITY_ENABLER_IF_HPP
|
||||
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// enabler_t
|
||||
// enabler
|
||||
//
|
||||
typedef void* enabler_t;
|
||||
extern enabler_t enabler;
|
||||
//
|
||||
// enabler_if
|
||||
//
|
||||
template<bool C>
|
||||
class enabler_if
|
||||
: public std::enable_if<C, enabler_t&>
|
||||
{};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_UTILITY_ENABLER_IF_HPP
|
Loading…
Add table
Add a link
Reference in a new issue