Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76031 - sandbox/closure/boost/closure/aux_/preprocessor/traits
From: lorcaminiti_at_[hidden]
Date: 2011-12-17 15:21:05


Author: lcaminiti
Date: 2011-12-17 15:21:05 EST (Sat, 17 Dec 2011)
New Revision: 76031
URL: http://svn.boost.org/trac/boost/changeset/76031

Log:
Split pp_param_traits.
Added:
   sandbox/closure/boost/closure/aux_/preprocessor/traits/param.hpp (contents, props changed)

Added: sandbox/closure/boost/closure/aux_/preprocessor/traits/param.hpp
==============================================================================
--- (empty file)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/param.hpp 2011-12-17 15:21:05 EST (Sat, 17 Dec 2011)
@@ -0,0 +1,35 @@
+
+// Copyright (C) 2009-2011 Lorenzo Caminiti
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
+// copy at http://www.boost.org/LICENSE_1_0.txt).
+
+#ifndef BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_HPP_
+#define BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_HPP_
+
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// PRIVATE //
+
+// Param 2-tuple `([auto | register] type name, default_value)`.
+#define BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_INDEX_DECL_ 0
+#define BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_INDEX_DEFAULT_ 1
+#define BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_INDEX_MAX_ 2
+
+// PUBLIC //
+
+// Expand: `[auto | register] type_ name_` (parameter declaration).
+#define BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_DECL(param_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_INDEX_MAX_, \
+ BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_INDEX_DECL_, param_traits)
+
+// Expand: `default ... EMPTY()` if default value, `EMPTY()` otherwise.
+// Leading default is kept because default value might not be alphanumeric
+// (e.g., -123) so failing `CAT` for `IS_EMPTY` check.
+#define BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_INDEX_MAX_, \
+ BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_INDEX_DEFAULT_, param_traits) \
+ (/* expand EMPTY */)
+
+#endif // #include guard
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk