Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:26

0001 
0002 #ifndef BOOST_CONTRACT_DETAIL_NONE_HPP_
0003 #define BOOST_CONTRACT_DETAIL_NONE_HPP_
0004 
0005 // Copyright (C) 2008-2018 Lorenzo Caminiti
0006 // Distributed under the Boost Software License, Version 1.0 (see accompanying
0007 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
0008 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
0009 
0010 namespace boost { namespace contract { namespace detail {
0011 
0012 // Tag for "no type".
0013 struct none {
0014     // Some lib code use this to avoid unused local var warnings on #if, etc.
0015     static none& value() {
0016         static none none_value;
0017         return none_value;
0018     }
0019 };
0020 
0021 // Transform `void` to `none` type (for convenience, instead of using MPL).
0022 template<typename T> struct none_if_void { typedef T type; };
0023 template<> struct none_if_void<void> { typedef none type; };
0024 
0025 } } } // namespace
0026 
0027 #endif // #include guard
0028