|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60297 - in sandbox/statistics/detail/assign: boost/assign/auto_size/detail libs/assign/example
From: erwann.rogard_at_[hidden]
Date: 2010-03-07 09:18:45
Author: e_r
Date: 2010-03-07 09:18:44 EST (Sun, 07 Mar 2010)
New Revision: 60297
URL: http://svn.boost.org/trac/boost/changeset/60297
Log:
m
Added:
sandbox/statistics/detail/assign/boost/assign/auto_size/detail/has_static_size.hpp (contents, props changed)
sandbox/statistics/detail/assign/boost/assign/auto_size/detail/static_size.hpp (contents, props changed)
Text files modified:
sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
Added: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/has_static_size.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/has_static_size.hpp 2010-03-07 09:18:44 EST (Sun, 07 Mar 2010)
@@ -0,0 +1,66 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::has_static_size.hpp //
+// //
+// (C) Copyright 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_ASSIGN_DETAIL_AUTO_SIZE_HAS_STATIC_SIZE_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_HAS_STATIC_SIZE_ER_2010_HPP
+#include <boost/mpl/bool.hpp>
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+ // TODO
+ template<typename T>
+ struct has_static_size{
+/*
+ typedef typename T::size_type size_type;
+ typedef char yes;
+ typedef char (&no)[2];
+ typedef const size_type* sig;
+// typedef size_type (const T::*sig)();
+
+ template<typename U,sig>
+ struct sfinae { };
+
+ template<typename U> static yes test(sfinae<U, &U::static_size> *);
+ //template<typename U> static yes test(sfinae<U,&U::size> *);
+ template<typename U> static no test(...);
+
+ BOOST_STATIC_CONSTANT(
+ bool,
+ value = sizeof( test<T>(0) ) == sizeof(yes)
+ );
+
+ typedef boost::mpl::bool_<value> type;
+*/
+ };
+}
+}
+}
+
+ template<typename T,std::size_t N>
+ struct array;
+
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+ // temporary fix
+ template<typename T,std::size_t N>
+ struct has_static_size<boost::array<T,N> > : boost::mpl::bool_<true>{};
+
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif
+
+
\ No newline at end of file
Added: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/static_size.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/static_size.hpp 2010-03-07 09:18:44 EST (Sun, 07 Mar 2010)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::static_size.hpp //
+// //
+// (C) Copyright 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_ASSIGN_DETAIL_AUTO_SIZE_STATIC_SIZE_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_STATIC_SIZE_ER_2010_HPP
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+ template<typename T>
+ struct static_size{
+
+ typedef typename T::size_type size_type;
+
+ BOOST_STATIC_CONSTANT(
+ size_type,
+ value = T::static_size
+ );
+ };
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif
+
+
\ No newline at end of file
Modified: sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp 2010-03-07 09:18:44 EST (Sun, 07 Mar 2010)
@@ -39,10 +39,7 @@
array.assign(-1);
typedef boost::mpl::int_<3> K_;
BOOST_AUTO(tmp,
- cref_list_of(a)(b)(c)
- .range(
- array
- )
+ cref_list_of(a)(b)(c).range(array)
);
BOOST_ASSERT(tmp[0] == a);
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