mirror of
https://github.com/boostorg/intrusive.git
synced 2025-05-11 21:23:56 +00:00
Simplified mutexes for systems with no _POSIX_TIMEOUTS.
[SVN r41540]
This commit is contained in:
parent
3fcccd0fbd
commit
2d20786a29
@ -1,3 +1,11 @@
|
|||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2004 Joel de Guzman
|
||||||
|
http://spirit.sourceforge.net/
|
||||||
|
|
||||||
|
Use, modification and distribution is 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)
|
||||||
|
=============================================================================*/
|
||||||
PRE.synopsis {
|
PRE.synopsis {
|
||||||
background-color: #e0ffff;
|
background-color: #e0ffff;
|
||||||
border: thin solid blue;
|
border: thin solid blue;
|
||||||
|
@ -75,5 +75,4 @@ int main()
|
|||||||
algo::erase(&header, &three);
|
algo::erase(&header, &three);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
//]
|
||||||
//]
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
add includes needed for the snippets
|
|
||||||
add section explaining splice(...,n)
|
|
||||||
Faltaría, en mi opinión, una guía de qué headers incluyen a cuáles. P.ej.,
|
|
||||||
los *_hook.hpp típicamente están incluidos por el header del contenedor asociado, etc.
|
|
||||||
Add resize() to list
|
|
||||||
Optimize rehash for when shrinking: there is no need to hash the values.
|
|
||||||
Optimize store_hash<true> to work with the same node and type traits as store_hash<false>
|
|
@ -1,65 +0,0 @@
|
|||||||
#ifndef BOOST_INTRUSIVE_TEST_TEST_TEMPLATES_HPP
|
|
||||||
#define BOOST_INTRUSIVE_TEST_TEST_TEMPLATES_HPP
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
namespace intrusive {
|
|
||||||
namespace test {
|
|
||||||
|
|
||||||
template<class Container>
|
|
||||||
void test_shift()
|
|
||||||
{
|
|
||||||
typedef typename ValueTraits::value_type testvalue_t;
|
|
||||||
boost::test_tools::output_test_stream test_seq;
|
|
||||||
Container test_cont;
|
|
||||||
const int NumElem = 6;
|
|
||||||
|
|
||||||
std::vector<typename Container::value_type> values(NumElem);
|
|
||||||
for(int i = 0; i < NumElem; ++i){
|
|
||||||
values[i] = i+1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int num_values = (int)values.size();
|
|
||||||
std::vector<int> expected_values(num_values);
|
|
||||||
|
|
||||||
//Shift forward all possible positions 3 times
|
|
||||||
for(int i = 0; i < num_values*3; ++i){
|
|
||||||
test_cont.assign(values.begin(), values.end());
|
|
||||||
test_cont.shift_forward(i);
|
|
||||||
for(int j = 0; j < num_values; ++j){
|
|
||||||
expected_values[(j + num_values - i%num_values) % num_values] = (j + 1);
|
|
||||||
}
|
|
||||||
std::copy (test_cont.begin(), test_cont.end(),
|
|
||||||
std::ostream_iterator<testvalue_t> (test_seq));
|
|
||||||
std::stringstream stream;
|
|
||||||
std::copy (expected_values.begin(), expected_values.end(),
|
|
||||||
std::ostream_iterator<testvalue_t> (stream));
|
|
||||||
stream << std::ends;
|
|
||||||
BOOST_CHECK (test_seq.is_equal (stream.str().c_str()));
|
|
||||||
test_cont.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Shift backwards all possible positions
|
|
||||||
for(int i = 0; i < num_values*2; ++i){
|
|
||||||
test_cont.assign(values.begin(), values.end());
|
|
||||||
test_cont.shift_backwards(i);
|
|
||||||
for(int j = 0; j < num_values; ++j){
|
|
||||||
expected_values[(j + i) % num_values] = (j + 1);
|
|
||||||
}
|
|
||||||
std::copy (test_cont.begin(), test_cont.end(),
|
|
||||||
std::ostream_iterator<testvalue_t> (test_seq));
|
|
||||||
std::stringstream stream;
|
|
||||||
std::copy (expected_values.begin(), expected_values.end(),
|
|
||||||
std::ostream_iterator<testvalue_t> (stream));
|
|
||||||
stream << std::ends;
|
|
||||||
BOOST_CHECK (test_seq.is_equal (stream.str().c_str()));
|
|
||||||
test_cont.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace test {
|
|
||||||
} //namespace intrusive {
|
|
||||||
} //namespace boost {
|
|
||||||
|
|
||||||
#endif //#ifndef BOOST_INTRUSIVE_TEST_TEST_TEMPLATES_HPP
|
|
Loading…
x
Reference in New Issue
Block a user