Boost logo

Boost-Commit :

From: dave_at_[hidden]
Date: 2007-11-04 23:43:34


Author: dave
Date: 2007-11-04 23:43:31 EST (Sun, 04 Nov 2007)
New Revision: 40770
URL: http://svn.boost.org/trac/boost/changeset/40770

Log:

Moved boost/concept/where.hpp to boost/concept/requires.hpp

Updated reference.htm to include BOOST_CONCEPT_REQUIRES

Fixed a copyright notice.

Added:
   trunk/boost/concept/requires.hpp
      - copied unchanged from r40769, /trunk/boost/concept/where.hpp
Removed:
   trunk/boost/concept/where.hpp
Text files modified:
   trunk/libs/concept_check/bibliography.htm | 17 +++++------------
   trunk/libs/concept_check/fake_sort.hpp | 2 +-
   trunk/libs/concept_check/reference.htm | 17 +++++++++++++++++
   3 files changed, 23 insertions(+), 13 deletions(-)

Deleted: trunk/boost/concept/where.hpp
==============================================================================
--- trunk/boost/concept/where.hpp 2007-11-04 23:43:31 EST (Sun, 04 Nov 2007)
+++ (empty file)
@@ -1,74 +0,0 @@
-// Copyright David Abrahams 2006. Distributed under 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_CONCEPT_REQUIRES_DWA2006430_HPP
-# define BOOST_CONCEPT_REQUIRES_DWA2006430_HPP
-
-# include <boost/parameter/aux_/parenthesized_type.hpp>
-# include <boost/concept/assert.hpp>
-# include <boost/preprocessor/seq/for_each.hpp>
-
-namespace boost {
-
-// Template for use in handwritten assertions
-template <class Model, class More>
-struct requires_ : More
-{
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- typedef typename More::type type;
-# endif
- BOOST_CONCEPT_ASSERT((Model));
-};
-
-// Template for use by macros, where models must be wrapped in parens.
-// This isn't in namespace detail to keep extra cruft out of resulting
-// error messages.
-template <class ModelFn>
-struct _requires_
-{
- enum { value = 0 };
- BOOST_CONCEPT_ASSERT_FN(ModelFn);
-};
-
-template <int check, class Result>
-struct Requires_ : ::boost::parameter::aux::unaryfunptr_arg_type<Result>
-{
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- typedef typename ::boost::parameter::aux::unaryfunptr_arg_type<Result>::type type;
-# endif
-};
-
-
-#define BOOST_CONCEPT_REQUIRES_(r,data,t) + (::boost::_requires_<void(*)t>::value)
-
-#if defined(NDEBUG) || BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-
-# define BOOST_CONCEPT_REQUIRES(models, result) \
- typename ::boost::parameter::aux::unaryfunptr_arg_type<void(*)result>::type
-
-#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-
-// Same thing as below without the initial typename
-# define BOOST_CONCEPT_REQUIRES(models, result) \
- ::boost::Requires_< \
- (0 BOOST_PP_SEQ_FOR_EACH(BOOST_CONCEPT_REQUIRES_, ~, models)), \
- ::boost::parameter::aux::unaryfunptr_arg_type<void(*)result> \
- >::type
-
-#else
-
-// This just ICEs on MSVC6 :(
-# define BOOST_CONCEPT_REQUIRES(models, result) \
- typename ::boost::Requires_< \
- (0 BOOST_PP_SEQ_FOR_EACH(BOOST_CONCEPT_REQUIRES_, ~, models)), \
- void(*)result \
- >::type
-
-#endif
-
-// C++0x proposed syntax changed. This supports an older usage
-#define BOOST_CONCEPT_WHERE(models,result) BOOST_CONCEPT_REQUIRES(models,result)
-
-} // namespace boost::concept_check
-
-#endif // BOOST_CONCEPT_REQUIRES_DWA2006430_HPP

Modified: trunk/libs/concept_check/bibliography.htm
==============================================================================
--- trunk/libs/concept_check/bibliography.htm (original)
+++ trunk/libs/concept_check/bibliography.htm 2007-11-04 23:43:31 EST (Sun, 04 Nov 2007)
@@ -1,17 +1,10 @@
 <HTML>
-<!--
- -- Copyright (c) Jeremy Siek 2000
- --
- -- Permission to use, copy, modify, distribute and sell this software
- -- and its documentation for any purpose is hereby granted without fee,
- -- provided that the above copyright notice appears in all copies and
- -- that both that copyright notice and this permission notice appear
- -- in supporting documentation. Silicon Graphics makes no
- -- representations about the suitability of this software for any
- -- purpose. It is provided "as is" without express or implied warranty.
- -->
+<!-- Copyright (c) Jeremy Siek 2000 -->
+<!-- Distributed under 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) -->
 <Head>
-<Title>Boost Graph Library: Bibliography</Title>
+<Title>Boost Concept Checking Library: Bibliography</Title>
 <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
         ALINK="#ff0000">
 <IMG SRC="../../boost.png"

Modified: trunk/libs/concept_check/fake_sort.hpp
==============================================================================
--- trunk/libs/concept_check/fake_sort.hpp (original)
+++ trunk/libs/concept_check/fake_sort.hpp 2007-11-04 23:43:31 EST (Sun, 04 Nov 2007)
@@ -5,7 +5,7 @@
 # define BOOST_LIBS_CONCEPT_CHECK_FAKE_SORT_DWA2006430_HPP
 
 # include <boost/detail/iterator.hpp>
-# include <boost/concept/where.hpp>
+# include <boost/concept/requires.hpp>
 # include <boost/concept_check.hpp>
 
 namespace fake

Modified: trunk/libs/concept_check/reference.htm
==============================================================================
--- trunk/libs/concept_check/reference.htm (original)
+++ trunk/libs/concept_check/reference.htm 2007-11-04 23:43:31 EST (Sun, 04 Nov 2007)
@@ -66,6 +66,23 @@
   <strong>Note:</strong> this macro can be used at global, class, or function
   scope.</p>
 
+ <pre>
+#include "boost/concept/requires.hpp"
+
+<font color="gray">template &lt;…<em>template parameters</em>…&gt;</font>
+BOOST_CONCEPT_REQUIRES(
+ ((<em>concept checking class template specialization<sub>1</sub></em>))
+ ((<em>concept checking class template specialization<sub>2</sub></em>))…
+ ((<em>concept checking class template specialization<sub>n</sub></em>))<strong>,</strong>
+ (<em>function return type</em>)
+) <font color="gray"><em>function_template_name</em>(…<em>function parameters</em>…)</font>
+</pre>
+
+ <p><strong>Effects:</strong> causes a compilation failure if the
+ given concepts are not satisfied.<br />
+ <strong>Note:</strong> this macro is intended to be used in place of
+ a function template's return type.</p>
+
   <h3><a name="basic-concepts" id="basic-concepts">Basic Concept Checking
   Classes</a></h3>
   <pre>


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