Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/circular_buffer/space_optimized.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
9 // http://www.boost.org/LICENSE_1_0.txt) | 9 // http://www.boost.org/LICENSE_1_0.txt) |
10 | 10 |
11 #if !defined(BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP) | 11 #if !defined(BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP) |
12 #define BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP | 12 #define BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP |
13 | 13 |
14 #if defined(_MSC_VER) && _MSC_VER >= 1200 | 14 #if defined(_MSC_VER) |
15 #pragma once | 15 #pragma once |
16 #endif | 16 #endif |
17 | 17 |
18 #include <boost/type_traits/is_same.hpp> | 18 #include <boost/type_traits/is_same.hpp> |
19 #include <boost/detail/workaround.hpp> | 19 #include <boost/detail/workaround.hpp> |
413 */ | 413 */ |
414 circular_buffer_space_optimized(capacity_type capacity_ctrl, size_type n, param_value_type item, | 414 circular_buffer_space_optimized(capacity_type capacity_ctrl, size_type n, param_value_type item, |
415 const allocator_type& alloc = allocator_type()) | 415 const allocator_type& alloc = allocator_type()) |
416 : circular_buffer<T, Alloc>(init_capacity(capacity_ctrl, n), n, item, alloc) | 416 : circular_buffer<T, Alloc>(init_capacity(capacity_ctrl, n), n, item, alloc) |
417 , m_capacity_ctrl(capacity_ctrl) {} | 417 , m_capacity_ctrl(capacity_ctrl) {} |
418 | |
419 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) | |
420 | |
421 /*! \cond */ | |
422 circular_buffer_space_optimized(const circular_buffer_space_optimized<T, Alloc>& cb) | |
423 : circular_buffer<T, Alloc>(cb.begin(), cb.end()) | |
424 , m_capacity_ctrl(cb.m_capacity_ctrl) {} | |
425 | |
426 template <class InputIterator> | |
427 circular_buffer_space_optimized(InputIterator first, InputIterator last) | |
428 : circular_buffer<T, Alloc>(first, last) | |
429 , m_capacity_ctrl(circular_buffer<T, Alloc>::capacity()) {} | |
430 | |
431 template <class InputIterator> | |
432 circular_buffer_space_optimized(capacity_type capacity_ctrl, InputIterator first, InputIterator last) | |
433 : circular_buffer<T, Alloc>( | |
434 init_capacity(capacity_ctrl, first, last, is_integral<InputIterator>()), | |
435 first, last) | |
436 , m_capacity_ctrl(capacity_ctrl) { | |
437 reduce_capacity( | |
438 is_same< BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<InputIterator>::type, std::input_iterator_tag >()); | |
439 } | |
440 /*! \endcond */ | |
441 | |
442 #else | |
443 | 418 |
444 //! The copy constructor. | 419 //! The copy constructor. |
445 /*! | 420 /*! |
446 Creates a copy of the specified <code>circular_buffer_space_optimized</code>. | 421 Creates a copy of the specified <code>circular_buffer_space_optimized</code>. |
447 \post <code>*this == cb</code><br><br> | 422 \post <code>*this == cb</code><br><br> |
532 : circular_buffer<T, Alloc>( | 507 : circular_buffer<T, Alloc>( |
533 init_capacity(capacity_ctrl, first, last, is_integral<InputIterator>()), | 508 init_capacity(capacity_ctrl, first, last, is_integral<InputIterator>()), |
534 first, last, alloc) | 509 first, last, alloc) |
535 , m_capacity_ctrl(capacity_ctrl) { | 510 , m_capacity_ctrl(capacity_ctrl) { |
536 reduce_capacity( | 511 reduce_capacity( |
537 is_same< BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<InputIterator>::type, std::input_iterator_tag >()); | 512 is_same< BOOST_DEDUCED_TYPENAME iterator_category<InputIterator>::type, std::input_iterator_tag >()); |
538 } | 513 } |
539 | |
540 #endif // #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) | |
541 | 514 |
542 #if defined(BOOST_CB_NEVER_DEFINED) | 515 #if defined(BOOST_CB_NEVER_DEFINED) |
543 // This section will never be compiled - the default destructor will be generated instead. | 516 // This section will never be compiled - the default destructor will be generated instead. |
544 // Declared only for documentation purpose. | 517 // Declared only for documentation purpose. |
545 | 518 |
1630 template <class Iterator> | 1603 template <class Iterator> |
1631 static size_type init_capacity(const capacity_type& capacity_ctrl, Iterator first, Iterator last, | 1604 static size_type init_capacity(const capacity_type& capacity_ctrl, Iterator first, Iterator last, |
1632 const false_type&) { | 1605 const false_type&) { |
1633 BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type | 1606 BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type |
1634 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581)) | 1607 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581)) |
1635 return init_capacity(capacity_ctrl, first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type()); | 1608 return init_capacity(capacity_ctrl, first, last, iterator_category<Iterator>::type()); |
1636 #else | 1609 #else |
1637 return init_capacity( | 1610 return init_capacity( |
1638 capacity_ctrl, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type()); | 1611 capacity_ctrl, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type()); |
1639 #endif | 1612 #endif |
1640 } | 1613 } |
1641 | 1614 |
1642 //! Specialized method for determining the initial capacity. | 1615 //! Specialized method for determining the initial capacity. |
1643 template <class InputIterator> | 1616 template <class InputIterator> |