MLPACK  1.0.11
Macros
sfinae_utility.hpp File Reference
Include dependency graph for sfinae_utility.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HAS_MEM_FUNC(FUNC, NAME)
 

Detailed Description

Author
Trironk Kiatkungwanglai

This file contains macro utilities for the SFINAE Paradigm. These utilities determine if classes passed in as template parameters contain members at compile time, which is useful for changing functionality depending on what operations an object is capable of performing.

This file is part of MLPACK 1.0.11.

MLPACK is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

MLPACK 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 Lesser General Public License for more details (LICENSE.txt).

You should have received a copy of the GNU General Public License along with MLPACK. If not, see http://www.gnu.org/licenses/.

Definition in file sfinae_utility.hpp.

Macro Definition Documentation

#define HAS_MEM_FUNC (   FUNC,
  NAME 
)
Value:
template<typename T, typename sig> \
struct NAME { \
typedef char yes[1]; \
typedef char no [2]; \
template<typename U, U> struct type_check; \
template<typename _1> static yes &chk(type_check<sig, &_1::FUNC> *); \
template<typename > static no &chk(...); \
static bool const value = sizeof(chk<T>(0)) == sizeof(yes); \
};

Definition at line 51 of file sfinae_utility.hpp.