LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
generic-variant.hh File Reference

Interface of misc::generic_variant. More...

#include <boost/variant.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <misc/generic-variant.hxx>
Include dependency graph for generic-variant.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  misc::generic_variant< T0_, >

Namespaces

namespace  boost
namespace  boost::detail
namespace  boost::detail::variant
namespace  misc
 Handling of generic, oriented or undirected, graph.

Macros

#define BOOST_VARIANT_DETAIL_DEFINE_VOID_N(z, N, _)
#define MISC_GENERIC_VARIANT_AUX_DECLARE_PARAMS_IMPL(z, N, T)   typename BOOST_PP_CAT(T, N) = BOOST_PP_CAT(boost::detail::variant::void, N)
#define MISC_GENERIC_VARIANT_AUX_DECLARE_PARAMS
#define MISC_GENERIC_VARIANT_CONVERSION_OPERATOR_DECL(z, N, T)   operator BOOST_PP_CAT(T,N) & ();
#define MISC_GENERIC_VARIANT_CONST_CONVERSION_OPERATOR_DECL(z, N, T)   operator const BOOST_PP_CAT(T,N) & () const;

Detailed Description

Interface of misc::generic_variant.

misc::generic_variant is a wrapper over boost::variant that adds conversion operators to the original Boost variant class.

See Also
misc::variant

This class is not used in the Tiger Compiler. It has been left here as an example of wrapper around a Boost class, showing interesting (but quite delicate) features such as the Boost Preprocessor Library (a set of macros for preprocessor metaprogramming).

misc::generic_variant is used just like boost::variant, and you won't be disturbed when using it. Unfortunately, its implementation code is very difficult to read. Hence, a simpler version of this class (where the number of underlying types in the variant is fixed) is provided, misc::variant. This is the one actually used in the compiler.

Macro Definition Documentation

#define BOOST_VARIANT_DETAIL_DEFINE_VOID_N (   z,
  N,
 
)
Value:
struct BOOST_PP_CAT(void, N); \
\
template<> \
struct convert_void< BOOST_PP_CAT(void, N) > \
{ \
typedef mpl::na type; \
};
#define MISC_GENERIC_VARIANT_AUX_DECLARE_PARAMS
Value:
BOOST_PP_ENUM( \
BOOST_VARIANT_LIMIT_TYPES \
, T \
)
#define MISC_GENERIC_VARIANT_AUX_DECLARE_PARAMS_IMPL (   z,
  N,
 
)    typename BOOST_PP_CAT(T, N) = BOOST_PP_CAT(boost::detail::variant::void, N)
#define MISC_GENERIC_VARIANT_CONST_CONVERSION_OPERATOR_DECL (   z,
  N,
 
)    operator const BOOST_PP_CAT(T,N) & () const;
#define MISC_GENERIC_VARIANT_CONVERSION_OPERATOR_DECL (   z,
  N,
 
)    operator BOOST_PP_CAT(T,N) & ();

Conversion operators generators (declarations).