File: myenableif.h

package info (click to toggle)
combblas 2.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 190,476 kB
  • sloc: cpp: 55,912; ansic: 25,134; sh: 3,691; makefile: 548; csh: 66; python: 49; perl: 21
file content (17 lines) | stat: -rw-r--r-- 518 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _MY_ENABLE_IF_
#define _MY_ENABLE_IF_

namespace combblas {
// ABAB: A simple enable_if construct for now
template <bool, class T = void> struct enable_if {};
template <class T> struct enable_if<true, T> { typedef T type; };

template <bool, class T = void> struct disable_if { typedef T type; };
template <class T> struct disable_if<true, T> {};

template <typename T> struct is_boolean { static const bool value = false; };
template <> struct is_boolean<bool> { static const bool value = true; };
}

#endif