fw4spl
traits.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWCAMP_CAMP_TRAITS_HPP__
8 #define __FWCAMP_CAMP_TRAITS_HPP__
9 
10 #include <camp/detail/yesnotype.hpp>
11 
12 namespace camp
13 {
14 
15 
16 template <typename T>
17 struct isMapping
18 {
19  template <typename U> static camp::detail::TypeYes check(typename U::mapped_type*);
20  template <typename U> static camp::detail::TypeNo check(...);
21 
22  //fwData hack to avoid composite passing this test
23  template <typename U> static camp::detail::TypeNo checkSptr(typename U::sptr*);
24  template <typename U> static camp::detail::TypeYes checkSptr(...);
25 
26  enum {value = (
27  sizeof(check< T >(0)) == sizeof(camp::detail::TypeYes)
28  && sizeof(checkSptr< T >(0)) == sizeof(camp::detail::TypeYes)
29  ) };
30 };
31 
32 
33 }// namespace camp
34 
35 
36 
37 
38 #endif /* __FWCAMP_CAMP_TRAITS_HPP__ */