Simplified mutexes for systems with no _POSIX_TIMEOUTS.

[SVN r41540]
This commit is contained in:
Ion Gaztañaga 2007-12-01 18:01:15 +00:00
parent 3fcccd0fbd
commit 2d20786a29
4 changed files with 9 additions and 74 deletions

View File

@ -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 {
background-color: #e0ffff;
border: thin solid blue;

View File

@ -75,5 +75,4 @@ int main()
algo::erase(&header, &three);
return 0;
}
//]
//]

View File

@ -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>

View File

@ -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