|
Boost-Commit : |
From: chochlik_at_[hidden]
Date: 2008-04-30 07:52:35
Author: matus.chochlik
Date: 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
New Revision: 44924
URL: http://svn.boost.org/trac/boost/changeset/44924
Log:
Updated several sources to comply with the Boost Coding Guidelines for Integral Constant Expressions
Text files modified:
sandbox/mirror/boost/mirror/common_defs.hpp | 7 +----
sandbox/mirror/boost/mirror/detail/array_type_name.hpp | 8 +++---
sandbox/mirror/boost/mirror/detail/const_type_name.hpp | 10 ++++----
sandbox/mirror/boost/mirror/detail/cv_type_name.hpp | 10 ++++----
sandbox/mirror/boost/mirror/detail/nontrivial_type_name.hpp | 32 +++++++++++++++---------------
sandbox/mirror/boost/mirror/detail/ptr_ref_type_name.hpp | 10 ++++----
sandbox/mirror/boost/mirror/detail/template_name.hpp | 12 +++++-----
sandbox/mirror/boost/mirror/detail/volatile_type_name.hpp | 10 ++++----
sandbox/mirror/boost/mirror/meta_namespace.hpp | 20 +++++++++---------
sandbox/mirror/boost/mirror/meta_type.hpp | 42 ++++++++++++++++++++--------------------
sandbox/mirror/boost/mirror/meta_types/boost_tuple.hpp | 12 +---------
sandbox/mirror/boost/mirror/meta_types/std_list.hpp | 12 +---------
sandbox/mirror/boost/mirror/meta_types/std_map.hpp | 12 +---------
sandbox/mirror/boost/mirror/meta_types/std_pair.hpp | 12 +---------
sandbox/mirror/boost/mirror/meta_types/std_set.hpp | 12 +---------
sandbox/mirror/boost/mirror/meta_types/std_slist.hpp | 12 +---------
sandbox/mirror/boost/mirror/meta_types/std_vector.hpp | 12 +---------
sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml | 6 +++++
sandbox/mirror/libs/mirror/example/registering/classes.cpp | 2
19 files changed, 100 insertions(+), 153 deletions(-)
Modified: sandbox/mirror/boost/mirror/common_defs.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/common_defs.hpp (original)
+++ sandbox/mirror/boost/mirror/common_defs.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -10,14 +10,11 @@
#ifndef BOOST_MIRROR_COMMON_DEFS_HPP
#define BOOST_MIRROR_COMMON_DEFS_HPP
+#include <boost/config.hpp>
+
namespace boost {
namespace mirror {
-/** Defines a constant class member attribute, named NAME
- * initialized with the VALUE and possibly being instace of TYPE
- */
-#define BOOST_MIRROR_CONST_MEMBER_ATTRIB(TYPE, NAME, VALUE) \
- enum {NAME = VALUE};
} // namespace mirror
} // namespace boost
Modified: sandbox/mirror/boost/mirror/detail/array_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/array_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/array_type_name.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -29,13 +29,13 @@
typedef nontrivial_type_base_or_full_name<meta_type, base_name>
name_info;
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, difference, 3 + size_as_string::length::value)
+ BOOST_STATIC_CONSTANT(size_t, difference = 3 + size_as_string::length::value);
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
+ BOOST_STATIC_CONSTANT(
size_t,
- name_length,
+ name_length =
name_info::name_length + difference
- )
+ );
static void init_name(bchar* the_name)
{
Modified: sandbox/mirror/boost/mirror/detail/const_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/const_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/const_type_name.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,13 +24,13 @@
typedef nontrivial_type_base_or_full_name<meta_type, base_type>
name_info;
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, difference, 6)
+ BOOST_STATIC_CONSTANT(int, difference = 6);
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- name_length,
+ BOOST_STATIC_CONSTANT(
+ int,
+ name_length =
name_info::name_length + difference
- )
+ );
static void init_name(bchar* the_name)
{
Modified: sandbox/mirror/boost/mirror/detail/cv_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/cv_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/cv_type_name.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,13 +24,13 @@
typedef nontrivial_type_base_or_full_name<meta_type, base_type>
name_info;
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, difference, 15)
+ BOOST_STATIC_CONSTANT(int, difference = 15);
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- name_length,
+ BOOST_STATIC_CONSTANT(
+ int,
+ name_length =
name_info::name_length + difference
- )
+ );
static void init_name(bchar* the_name)
{
Modified: sandbox/mirror/boost/mirror/detail/nontrivial_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/nontrivial_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/nontrivial_type_name.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -25,11 +25,11 @@
template <class meta_type>
struct nontrivial_type_base_or_full_name<meta_type, true>
{
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- name_length,
+ BOOST_STATIC_CONSTANT(
+ int,
+ name_length =
meta_type::base_name_length
- )
+ );
inline static const bchar* name(void)
{
return meta_type::base_name();
@@ -41,11 +41,11 @@
template <class meta_type>
struct nontrivial_type_base_or_full_name<meta_type, false>
{
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- name_length,
+ BOOST_STATIC_CONSTANT(
+ int,
+ name_length =
meta_type::full_name_length
- )
+ );
inline static const bchar* name(void)
{
return meta_type::full_name();
@@ -92,16 +92,16 @@
return the_name;
}
public:
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
+ BOOST_STATIC_CONSTANT(
+ int,
+ base_name_length =
implementation_base_name::name_length
- )
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
+ );
+ BOOST_STATIC_CONSTANT(
+ int,
+ full_name_length =
implementation_full_name::name_length
- )
+ );
static const bchar* base_name(void)
{
return get_name(mpl::bool_<true>());
Modified: sandbox/mirror/boost/mirror/detail/ptr_ref_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/ptr_ref_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/ptr_ref_type_name.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,13 +24,13 @@
typedef nontrivial_type_base_or_full_name<meta_type, base_name>
name_info;
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, difference, 3)
+ BOOST_STATIC_CONSTANT(int, difference = 3);
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- name_length,
+ BOOST_STATIC_CONSTANT(
+ int,
+ name_length =
name_info::name_length + difference
- )
+ );
static void init_name(bchar* the_name)
{
Modified: sandbox/mirror/boost/mirror/detail/template_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/template_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/template_name.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -123,17 +123,17 @@
typedef typename static_template_name_length<typelist, base_name>::type
template_param_list_length_type;
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
+ BOOST_STATIC_CONSTANT(
size_t,
- difference,
+ difference =
template_param_list_length_type::value
- )
+ );
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
+ BOOST_STATIC_CONSTANT(
size_t,
- name_length,
+ name_length =
name_info::name_length + difference
- )
+ );
static void init_name(bchar* the_name)
{
Modified: sandbox/mirror/boost/mirror/detail/volatile_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/volatile_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/volatile_type_name.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,13 +24,13 @@
typedef nontrivial_type_base_or_full_name<meta_type, base_type>
name_info;
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, difference, 9)
+ BOOST_STATIC_CONSTANT(int, difference = 9);
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- name_length,
+ BOOST_STATIC_CONSTANT(
+ int,
+ name_length =
name_info::name_length + difference
- )
+ );
static void init_name(bchar* the_name)
{
Modified: sandbox/mirror/boost/mirror/meta_namespace.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_namespace.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_namespace.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -40,10 +40,10 @@
typedef mpl::vector0<> scope;
static const bchar* base_name(void) {return BOOST_STR_LIT("");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, base_name_length, 0)
+ BOOST_STATIC_CONSTANT(int, base_name_length = 0);
static const bchar* full_name(void) {return BOOST_STR_LIT("");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, full_name_length, 0)
+ BOOST_STATIC_CONSTANT(int, full_name_length = 0);
};
@@ -53,18 +53,18 @@
{ \
typedef meta_namespace< namespaces :: PARENT_NS_ALIAS > parent; \
typedef mpl::push_back<parent::scope, parent>::type scope; \
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(\
- size_t, \
- base_name_length, \
+ BOOST_STATIC_CONSTANT(\
+ int, \
+ base_name_length = \
BOOST_STR_LIT_LENGTH(#NAMESPACE_NAME)\
- ) \
+ ); \
static const bchar* base_name(void) {return BOOST_STR_LIT(#NAMESPACE_NAME);} \
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(\
- size_t, \
- full_name_length, \
+ BOOST_STATIC_CONSTANT(\
+ int, \
+ full_name_length = \
parent::full_name_length + 2 + \
base_name_length \
- ) \
+ ); \
static const bchar* full_name(void)\
{\
static bchar the_full_name[full_name_length] = \
Modified: sandbox/mirror/boost/mirror/meta_type.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_type.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_type.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -50,12 +50,12 @@
/** Helper macro that declared the full_name-related stuff
*/
#define BOOST_MIRROR_TMP_DECLARE_META_TYPE_FULL_NAME() \
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(\
- size_t, \
- full_name_length, \
+ BOOST_STATIC_CONSTANT(\
+ int, \
+ full_name_length = \
scope::full_name_length + 2 + \
base_name_length \
- ) \
+ ); \
static const bchar* full_name(void)\
{\
static bchar the_full_name[full_name_length] = \
@@ -81,11 +81,11 @@
typedef BOOST_MIRROR_REFLECT_NAMESPACE(NAMESPACE_ALIAS) scope; \
typedef NAMESPACE::BASE_NAME base_type; \
static const bchar* base_name(void) {return BOOST_STR_LIT(#BASE_NAME);}\
- BOOST_MIRROR_CONST_MEMBER_ATTRIB( \
- size_t, \
- base_name_length, \
+ BOOST_STATIC_CONSTANT( \
+ int, \
+ base_name_length = \
BOOST_STR_LIT_LENGTH(#BASE_NAME)\
- ) \
+ ); \
BOOST_MIRROR_TMP_DECLARE_META_TYPE_FULL_NAME() \
};
@@ -101,11 +101,11 @@
typedef BOOST_MIRROR_REFLECT_NAMESPACE(NAMESPACE_ALIAS) scope; \
typedef NAMESPACE::TYPEDEFD_NAME base_type; \
static const bchar* base_name(void) {return BOOST_STR_LIT(#TYPEDEFD_NAME);}\
- BOOST_MIRROR_CONST_MEMBER_ATTRIB( \
- size_t, \
- base_name_length, \
+ BOOST_STATIC_CONSTANT( \
+ int, \
+ base_name_length = \
BOOST_STR_LIT_LENGTH(#TYPEDEFD_NAME)\
- ) \
+ ); \
BOOST_MIRROR_TMP_DECLARE_META_TYPE_FULL_NAME() \
};
@@ -117,13 +117,13 @@
typedef BOOST_MIRROR_REFLECT_NAMESPACE(_) scope; \
typedef BASE_NAME base_type; \
static const bchar* base_name(void) {return BOOST_STR_LIT(#BASE_NAME);}\
- BOOST_MIRROR_CONST_MEMBER_ATTRIB( \
- size_t, \
- base_name_length, \
+ BOOST_STATIC_CONSTANT( \
+ int, \
+ base_name_length = \
BOOST_STR_LIT_LENGTH( #BASE_NAME ) \
- ) \
+ ); \
static const bchar* full_name(void) {return base_name();}\
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(size_t, full_name_length, base_name_length) \
+ BOOST_STATIC_CONSTANT(int, full_name_length = base_name_length); \
};
/** Declaration of meta types for types in declared inside
@@ -135,11 +135,11 @@
typedef meta_class< WRAPPER > scope; \
typedef WRAPPER::BASE_NAME base_type; \
static const bchar* base_name(void) {return BOOST_STR_LIT(#BASE_NAME);}\
- BOOST_MIRROR_CONST_MEMBER_ATTRIB( \
- size_t, \
- base_name_length, \
+ BOOST_STATIC_CONSTANT( \
+ int, \
+ base_name_length = \
BOOST_STR_LIT_LENGTH(#BASE_NAME)\
- ) \
+ ); \
BOOST_MIRROR_TMP_DECLARE_META_TYPE_FULL_NAME() \
};
Modified: sandbox/mirror/boost/mirror/meta_types/boost_tuple.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/boost_tuple.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/boost_tuple.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -35,18 +35,10 @@
{
static const bchar* base_name(void){return BOOST_STR_LIT("tuple");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
- 5
- )
+ BOOST_STATIC_CONSTANT(int, base_name_length = 5);
static const bchar* full_name(void){return BOOST_STR_LIT("::boost::tuples::tuple");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
- 22
- )
+ BOOST_STATIC_CONSTANT(int, full_name_length = 22);
};
Modified: sandbox/mirror/boost/mirror/meta_types/std_list.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std_list.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std_list.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,18 +24,10 @@
{
static const bchar* base_name(void){return BOOST_STR_LIT("list");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
- 4
- )
+ BOOST_STATIC_CONSTANT(int, base_name_length = 4);
static const bchar* full_name(void){return BOOST_STR_LIT("::std::list");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
- 11
- )
+ BOOST_STATIC_CONSTANT(int, full_name_length = 11);
};
} // namespace detail
Modified: sandbox/mirror/boost/mirror/meta_types/std_map.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std_map.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std_map.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,18 +24,10 @@
{
static const bchar* base_name(void){return BOOST_STR_LIT("map");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
- 3
- )
+ BOOST_STATIC_CONSTANT(int, base_name_length = 3);
static const bchar* full_name(void){return BOOST_STR_LIT("::std::map");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
- 10
- )
+ BOOST_STATIC_CONSTANT(int, full_name_length = 10);
};
} // namespace detail
Modified: sandbox/mirror/boost/mirror/meta_types/std_pair.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std_pair.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std_pair.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -25,18 +25,10 @@
{
static const bchar* base_name(void){return BOOST_STR_LIT("pair");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
- 4
- )
+ BOOST_STATIC_CONSTANT(int, base_name_length = 4);
static const bchar* full_name(void){return BOOST_STR_LIT("::std::pair");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
- 11
- )
+ BOOST_STATIC_CONSTANT(int, full_name_length = 11);
};
} // namespace detail
Modified: sandbox/mirror/boost/mirror/meta_types/std_set.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std_set.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std_set.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,18 +24,10 @@
{
static const bchar* base_name(void){return BOOST_STR_LIT("set");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
- 3
- )
+ BOOST_STATIC_CONSTANT(int, base_name_length = 3);
static const bchar* full_name(void){return BOOST_STR_LIT("::std::set");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
- 10
- )
+ BOOST_STATIC_CONSTANT(int, full_name_length = 10);
};
} // namespace detail
Modified: sandbox/mirror/boost/mirror/meta_types/std_slist.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std_slist.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std_slist.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,18 +24,10 @@
{
static const bchar* base_name(void){return BOOST_STR_LIT("slist");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
- 5
- )
+ BOOST_STATIC_CONSTANT(int, base_name_length = 5);
static const bchar* full_name(void){return BOOST_STR_LIT("::std::slist");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
- 12
- )
+ BOOST_STATIC_CONSTANT(int, full_name_length = 12);
};
} // namespace detail
Modified: sandbox/mirror/boost/mirror/meta_types/std_vector.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std_vector.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std_vector.hpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -24,18 +24,10 @@
{
static const bchar* base_name(void){return BOOST_STR_LIT("vector");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- base_name_length,
- 6
- )
+ BOOST_STATIC_CONSTANT(int, base_name_length = 6);
static const bchar* full_name(void){return BOOST_STR_LIT("::std::vector");}
- BOOST_MIRROR_CONST_MEMBER_ATTRIB(
- size_t,
- full_name_length,
- 13
- )
+ BOOST_STATIC_CONSTANT(int, full_name_length = 13);
};
} // namespace detail
Modified: sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml
==============================================================================
--- sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml (original)
+++ sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -94,5 +94,11 @@
- Updated the special/boost_tuple.cpp example
- Tested with MSVC++ 2008 EE on Vista and g++ 4.1.3 on Ubuntu 7.10
</revision>
+ <revision id="20080430" major="0" minor="1" micro="15" author="m_ch">
+ - Updated several sources to comply with the Boost Coding Guidelines
+ for Integral Constant Expressions, now using the BOOST_STATIC_CONSTANT
+ macro.
+
+ </revision>
</revisions>
</library>
Modified: sandbox/mirror/libs/mirror/example/registering/classes.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/registering/classes.cpp (original)
+++ sandbox/mirror/libs/mirror/example/registering/classes.cpp 2008-04-30 07:52:33 EDT (Wed, 30 Apr 2008)
@@ -321,7 +321,7 @@
// or some other type in the future
using namespace ::std;
s << endl << " - " <<
- name_to_stream<BOOST_MIRROR_REFLECT_TYPE(attrib_type)>() <<
+ name_to_stream< BOOST_MIRROR_REFLECT_TYPE(attrib_type) >() <<
" " <<
ma.base_name(pos);
}
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