Simplistic enable_if SFINAE helper implementation
This commit is contained in:
parent
4fb7b8e30f
commit
d3c98d479e
@ -10,6 +10,7 @@ UTIL_INCLUDE = \
|
|||||||
annotations.hpp \
|
annotations.hpp \
|
||||||
backtrace.hpp \
|
backtrace.hpp \
|
||||||
debug.hpp \
|
debug.hpp \
|
||||||
|
enable_if.hpp \
|
||||||
except.hpp \
|
except.hpp \
|
||||||
float.hpp \
|
float.hpp \
|
||||||
io.hpp \
|
io.hpp \
|
||||||
|
33
enable_if.hpp
Normal file
33
enable_if.hpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of libgim.
|
||||||
|
*
|
||||||
|
* Waif is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later
|
||||||
|
* version.
|
||||||
|
*
|
||||||
|
* Waif is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
* details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with libgim. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* Copyright 2010 Danny Robson <danny@blubinc.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ENABLE_IF_HPP
|
||||||
|
#define __ENABLE_IF_HPP
|
||||||
|
|
||||||
|
template <bool B, typename T>
|
||||||
|
struct enable_if {
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct enable_if<false, T> { };
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __ENABLE_IF_HPP
|
Loading…
Reference in New Issue
Block a user