Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:34:42

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 #if !defined(FUSION_EMPTY_09162005_0335)
0008 #define FUSION_EMPTY_09162005_0335
0009 
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
0012 #include <boost/fusion/sequence/intrinsic/size.hpp>
0013 #include <boost/mpl/bool.hpp>
0014 #include <boost/fusion/support/tag_of.hpp>
0015 
0016 namespace boost { namespace fusion
0017 {
0018     // Special tags:
0019     struct sequence_facade_tag;
0020     struct mpl_sequence_tag; // mpl sequence tag
0021 
0022     namespace extension
0023     {
0024         template <typename Tag>
0025         struct empty_impl
0026         {
0027             template <typename Sequence>
0028             struct apply 
0029                 : mpl::bool_<(result_of::size<Sequence>::value == 0)>
0030             {};
0031         };
0032 
0033         template <>
0034         struct empty_impl<sequence_facade_tag>
0035         {
0036             template <typename Sequence>
0037             struct apply : Sequence::template empty<Sequence> {};
0038         };
0039 
0040         template <>
0041         struct empty_impl<mpl_sequence_tag>;
0042     }
0043 
0044     namespace result_of
0045     {
0046         template <typename Sequence>
0047         struct empty 
0048             : extension::empty_impl<typename detail::tag_of<Sequence>::type>::
0049                 template apply<Sequence>
0050         {};
0051     }
0052 
0053     template <typename Sequence>
0054     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0055     inline typename result_of::empty<Sequence>::type
0056     empty(Sequence const&)
0057     {
0058         typedef typename result_of::empty<Sequence>::type result;
0059         return result();
0060     }
0061 }}
0062 
0063 #endif