Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:02:39

0001 /*=============================================================================
0002     Copyright (c) 2001-2014 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_X3_UNUSED_APRIL_16_2006_0616PM)
0009 #define BOOST_SPIRIT_X3_UNUSED_APRIL_16_2006_0616PM
0010 
0011 #include <iosfwd>
0012 
0013 ///////////////////////////////////////////////////////////////////////////////
0014 namespace boost { namespace spirit { namespace x3
0015 {
0016     struct unused_type
0017     {
0018         unused_type() = default;
0019 
0020         template <typename T>
0021         unused_type(T const&)
0022         {
0023         }
0024 
0025         template <typename T>
0026         unused_type const&
0027         operator=(T const&) const
0028         {
0029             return *this;
0030         }
0031 
0032         template <typename T>
0033         unused_type&
0034         operator=(T const&)
0035         {
0036             return *this;
0037         }
0038 
0039         // unused_type can also masquerade as an empty context (see context.hpp)
0040 
0041         template <typename ID>
0042         unused_type get(ID) const
0043         {
0044             return {};
0045         }
0046 
0047         friend std::ostream& operator<<(std::ostream& out, unused_type const&)
0048         {
0049             return out;
0050         }
0051 
0052         friend std::istream& operator>>(std::istream& in, unused_type&)
0053         {
0054             return in;
0055         }
0056     };
0057 
0058     constexpr auto unused = unused_type{};
0059 }}}
0060 
0061 #endif