textwolf  0.2
traits.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 #ifndef __TEXTWOLF_TRAITS_HPP__
9 #define __TEXTWOLF_TRAITS_HPP__
10 
13 namespace textwolf {
14 namespace traits {
15 
18 class TypeCheck
19 {
20 public:
21  struct YES {};
22  struct NO {};
23 
24  template<typename T, typename U>
25  struct is_same
26  {
27  static const NO type() {return NO();}
28  };
29 
30  template<typename T>
31  struct is_same<T,T>
32  {
33  static const YES type() {return YES();}
34  };
35 };
36 
37 }}//namespace
38 #endif
Test structure to stear the compiler.
Definition: traits.hpp:18
static const YES type()
Definition: traits.hpp:33
static const NO type()
Definition: traits.hpp:27
Definition: traits.hpp:22
Definition: traits.hpp:25
Definition: traits.hpp:21