X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Fproperty_map.hpp;h=9077ea37cd10d3f690e08462244cacbad706b2dd;hb=b01a9dc187d9cd396a57463ad27511379dcdc9cd;hp=bafe9001f67c22faff44d016f895b18c8f31b565;hpb=fa06f3acc21a2035e115ef5d47adfd08c9494ff6;p=lyx.git diff --git a/boost/boost/property_map.hpp b/boost/boost/property_map.hpp index bafe9001f6..9077ea37cd 100644 --- a/boost/boost/property_map.hpp +++ b/boost/boost/property_map.hpp @@ -1,16 +1,17 @@ -// (C) Copyright Jeremy Siek 1999-2001. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. +// (C) Copyright Jeremy Siek 1999-2001. +// 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) + +// See http://www.boost.org/libs/property_map for documentation. #ifndef BOOST_PROPERTY_MAP_HPP #define BOOST_PROPERTY_MAP_HPP #include -#include #include #include +#include #include #include @@ -118,7 +119,7 @@ namespace boost { }; #endif -#ifndef BOOST_MSVC +#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) // MSVC doesn't have Koenig lookup, so the user has to // do boost::get() anyways, and the using clause // doesn't really work for MSVC. @@ -135,7 +136,7 @@ namespace boost { template inline const T& get(const T* pa, std::ptrdiff_t k) { return pa[k]; } -#ifndef BOOST_MSVC +#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) namespace boost { using ::put; using ::get; @@ -169,7 +170,9 @@ namespace boost { }; template const typename readable_property_map_archetype::reference& - get(const readable_property_map_archetype&, const K&) { + get(const readable_property_map_archetype&, + const typename readable_property_map_archetype::key_type&) + { typedef typename readable_property_map_archetype::reference R; return static_object::get(); } @@ -197,7 +200,9 @@ namespace boost { typedef writable_property_map_tag category; }; template - void put(const writable_property_map_archetype&, const K&, const V&) { } + void put(const writable_property_map_archetype&, + const typename writable_property_map_archetype::key_type&, + const typename writable_property_map_archetype::value_type&) { } template @@ -233,10 +238,10 @@ namespace boost { void constraints() { function_requires< ReadablePropertyMapConcept >(); function_requires< ConvertibleConcept >(); - + + typedef typename property_traits::value_type value_type; typedef typename require_same< - const typename property_traits::value_type&, - reference>::type req; + const value_type&, reference>::type req; reference ref = pmap[k]; ignore_unused_variable_warning(ref); @@ -266,8 +271,10 @@ namespace boost { void constraints() { boost::function_requires< ReadWritePropertyMapConcept >(); boost::function_requires >(); + + typedef typename property_traits::value_type value_type; typedef typename require_same< - typename property_traits::value_type&, + value_type&, reference>::type req; reference ref = pmap[k]; @@ -389,10 +396,11 @@ namespace boost { typedef boost::lvalue_property_map_tag category; inline safe_iterator_property_map( - RandomAccessIterator first = RandomAccessIterator(), - std::size_t n = 0, + RandomAccessIterator first, + std::size_t n_ = 0, const IndexMap& _id = IndexMap() ) - : iter(first), n(n), index(_id) { } + : iter(first), n(n_), index(_id) { } + inline safe_iterator_property_map() { } inline R operator[](key_type v) const { assert(get(index, v) < n); return *(iter + get(index, v)) ; @@ -408,14 +416,14 @@ namespace boost { template inline safe_iterator_property_map< RAIter, ID, - typename std::iterator_traits::value_type, - typename std::iterator_traits::reference> + typename boost::detail::iterator_traits::value_type, + typename boost::detail::iterator_traits::reference> make_safe_iterator_property_map(RAIter iter, std::size_t n, ID id) { function_requires< RandomAccessIteratorConcept >(); typedef safe_iterator_property_map< RAIter, ID, - typename std::iterator_traits::value_type, - typename std::iterator_traits::reference> PA; + typename boost::detail::iterator_traits::value_type, + typename boost::detail::iterator_traits::reference> PA; return PA(iter, n, id); } #endif @@ -474,7 +482,7 @@ namespace boost { const_associative_property_map() : m_c(0) { } const_associative_property_map(const C& c) : m_c(&c) { } reference operator[](const key_type& k) const { - return (*m_c)[k]; + return m_c->find(k)->second; } private: C const* m_c;