Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:09:33

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003     Copyright (c) 2001-2011 Hartmut Kaiser
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 #if !defined(BOOST_SPIRIT_UNUSED_APRIL_16_2006_0616PM)
0009 #define BOOST_SPIRIT_UNUSED_APRIL_16_2006_0616PM
0010 
0011 #if defined(_MSC_VER)
0012 #pragma once
0013 #endif
0014 
0015 #include <boost/config.hpp>
0016 #include <boost/mpl/bool.hpp>
0017 
0018 ///////////////////////////////////////////////////////////////////////////////
0019 namespace boost { namespace spirit
0020 {
0021     ///////////////////////////////////////////////////////////////////////////
0022     // We do not import fusion ::unused_type anymore to avoid boost::fusion
0023     // being turned into an associate namespace for boost::spirit, as this
0024     // interferes with ADL in unexpected ways. We rather copy the full 
0025     // unused_type implementation from boost::fusion.
0026     ///////////////////////////////////////////////////////////////////////////
0027     struct unused_type
0028     {
0029         BOOST_DEFAULTED_FUNCTION(unused_type(), {})
0030 
0031         template <typename T>
0032         unused_type(T const&)
0033         {
0034         }
0035 
0036         template <typename T>
0037         unused_type const&
0038         operator=(T const&) const
0039         {
0040             return *this;
0041         }
0042 
0043         template <typename T>
0044         unused_type&
0045         operator=(T const&)
0046         {
0047             return *this;
0048         }
0049     };
0050 
0051     unused_type const unused = unused_type();
0052 
0053     namespace detail
0054     {
0055         struct unused_only
0056         {
0057             unused_only(unused_type const&) {}
0058         };
0059     }
0060 
0061     template <typename Out>
0062     inline Out& operator<<(Out& out, detail::unused_only const&)
0063     {
0064         return out;
0065     }
0066 
0067     template <typename In>
0068     inline In& operator>>(In& in, unused_type&)
0069     {
0070         return in;
0071     }
0072 
0073     ///////////////////////////////////////////////////////////////////////////
0074     namespace traits
0075     {
0076         // We use this test to detect if the argument is not an unused_type
0077         template <typename T> struct not_is_unused : mpl::true_ {};
0078         template <> struct not_is_unused<unused_type> : mpl::false_ {};
0079     }
0080 }}
0081 
0082 #endif