PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/spirit/home/karma/auto/create_generator.hpp

http://hadesmem.googlecode.com/
C++ Header | 46 lines | 28 code | 7 blank | 11 comment | 0 complexity | 523ea10fd811ed8b16feb647a6221ffc MD5 | raw file
 1//  Copyright (c) 2001-2011 Hartmut Kaiser
 2//
 3//  Distributed under the Boost Software License, Version 1.0. (See accompanying
 4//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 5
 6#if !defined(BOOST_SPIRIT_KARMA_CREATE_NOV_21_2009_0340PM)
 7#define BOOST_SPIRIT_KARMA_CREATE_NOV_21_2009_0340PM
 8
 9#if defined(_MSC_VER)
10#pragma once
11#endif
12
13#include <boost/spirit/home/karma/auto/meta_create.hpp>
14
15///////////////////////////////////////////////////////////////////////////////
16namespace boost { namespace spirit { namespace result_of
17{
18    ///////////////////////////////////////////////////////////////////////////
19    template <typename T>
20    struct create_generator
21      : spirit::traits::meta_create<karma::domain, T> {};
22}}}
23
24///////////////////////////////////////////////////////////////////////////////
25namespace boost { namespace spirit { namespace karma
26{
27    // Main API function for generator creation from data type
28    template <typename T>
29    typename result_of::create_generator<T>::type
30    create_generator()
31    {
32        return spirit::traits::meta_create<karma::domain, T>::call();
33    }
34}}}
35
36///////////////////////////////////////////////////////////////////////////////
37namespace boost { namespace spirit { namespace traits
38{
39    // Meta function returning true if create_generator does return a valid
40    // generator for the given type T.
41    template <typename T>
42    struct create_generator_exists
43      : meta_create_exists<karma::domain, T> {};
44}}}
45
46#endif