mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

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 40 of file sfinae_utility.hpp.