diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-03-28 15:40:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 15:40:57 +0200 |
commit | 748b121703fa28b10933f4432c09391e66179118 (patch) | |
tree | 58a39b6a75c3e9127507bf3c185a99e546147276 /src/BlockType.h | |
parent | Fix Windows XP to 7 compatibility (#5167) (diff) | |
download | cuberite-748b121703fa28b10933f4432c09391e66179118.tar cuberite-748b121703fa28b10933f4432c09391e66179118.tar.gz cuberite-748b121703fa28b10933f4432c09391e66179118.tar.bz2 cuberite-748b121703fa28b10933f4432c09391e66179118.tar.lz cuberite-748b121703fa28b10933f4432c09391e66179118.tar.xz cuberite-748b121703fa28b10933f4432c09391e66179118.tar.zst cuberite-748b121703fa28b10933f4432c09391e66179118.zip |
Diffstat (limited to 'src/BlockType.h')
-rw-r--r-- | src/BlockType.h | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/BlockType.h b/src/BlockType.h index f98d9db82..4814c5a68 100644 --- a/src/BlockType.h +++ b/src/BlockType.h @@ -1181,36 +1181,3 @@ extern AString ItemToFullString(const cItem & a_Item); extern cItem GetIniItemSet(cIniFile & a_IniFile, const char * a_Section, const char * a_Key, const char * a_Default); // tolua_end - - - - - -/** Base case for IsOneOf to handle empty template aguments. */ -template <class = void> -bool IsOneOf(BLOCKTYPE a_BlockType) -{ - return false; -} - - -/** Returns true if a_BlockType is equal to any of the variadic template arguments. -Some example usage: -\code - IsOneOf<>(E_BLOCK_AIR) == false - IsOneOf<E_BLOCK_AIR>(E_BLOCK_DIRT) == false - IsOneOf<E_BLOCK_AIR, E_BLOCK_DIRT>(E_BLOCK_DIRT) == true -\endcode -The implementation is ugly but it is equivalent to this C++17 fold expression: -\code - ((a_BlockType == Types) || ...) -\endcode -Just written to be valid without fold expressions or SFINAE. */ -template <BLOCKTYPE Head, BLOCKTYPE ... Tail> -bool IsOneOf(BLOCKTYPE a_BlockType) -{ - return ((a_BlockType == Head) || (IsOneOf<Tail...>(a_BlockType))); -} - - - |