Compare commits

...

8 Commits

Author SHA1 Message Date
Beman Dawes
1b241db6ec Release 1.46.0
[SVN r69125]
2011-02-21 18:42:22 +00:00
Steven Watanabe
e6fc8e8ec9 Merge dynamic_bitset from the trunk
[SVN r67617]
2011-01-03 16:38:46 +00:00
Troy D. Straszheim
d77a2c4afa rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
Troy D. Straszheim
e3a2ca7276 Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
Daniel James
38819630fd Merge dynamic bitset fixes for gcc 4.3.3.
Merged revisions 52879-52881,53050 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r52879 | hkaiser | 2009-05-10 17:52:14 +0100 (Sun, 10 May 2009) | 1 line
  
  Applying patch fixing problem on certain patch levels for gcc.4.3.3/Ubuntu
........
  r52880 | hkaiser | 2009-05-10 17:55:07 +0100 (Sun, 10 May 2009) | 1 line
  
  Fixing the fix by taking into account __GNUC_PATCHLEVEL__ as well
........
  r52881 | hkaiser | 2009-05-10 17:59:27 +0100 (Sun, 10 May 2009) | 1 line
  
  Minor comment edit
........
  r53050 | danieljames | 2009-05-16 15:58:33 +0100 (Sat, 16 May 2009) | 13 lines
  
  Merge dynamic bitset from release.
  
  I think the recent changes in trunk and release were for the same problem. But
  I'm not sure so I've merged them together. Hopefully, the release branch might
  fix the Intel C++ errors as well.
  
  ------------------------------------------------------------------------
  r52960 | dgregor | 2009-05-13 07:11:03 +0100 (Wed, 13 May 2009) | 1 line
  
  Use enum constants rather than local variables for integral constants. Should fix dynamic_bitset failures on GCC 4.3.x
  ------------------------------------------------------------------------
........


[SVN r53259]
2009-05-25 20:26:02 +00:00
Douglas Gregor
6d0f9801f5 Use enum constants rather than local variables for integral constants. Should fix dynamic_bitset failures on GCC 4.3.x
[SVN r52960]
2009-05-13 06:11:03 +00:00
Troy D. Straszheim
b7eedd0f46 merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
Gennaro Prota
16ca9cbb3c dynamic_bitset: ported revisions 49433, 49586 from trunk
[SVN r50470]
2009-01-04 23:03:28 +00:00
4 changed files with 40 additions and 32 deletions

View File

@@ -71,8 +71,8 @@ void run_numeric_ctor_tests( BOOST_EXPLICIT_TEMPLATE_TYPE(Tests)
};
const T numbers[] = {
T(-1), T(-3), T(-8), T(-15), mi/2, mi,
0, 1, 3, 8, 15, ma/2, ma
T(-1), T(-3), T(-8), T(-15), T(mi/2), T(mi),
T(0), T(1), T(3), T(8), T(15), T(ma/2), T(ma)
};
for (std::size_t s = 0; s < BOOST_BITSET_TEST_COUNT(sizes); ++s) {

View File

@@ -212,6 +212,7 @@ public:
bool <a href="#is_subset_of">is_subset_of</a>(const dynamic_bitset&amp; a) const;
bool <a href="#is_proper_subset_of">is_proper_subset_of</a>(const dynamic_bitset&amp; a) const;
bool <a href="#intersects">intersects</a>(const dynamic_bitset&amp; a) const;
size_type <a href="#find_first">find_first</a>() const;
size_type <a href="#find_next">find_next</a>(size_type pos) const;
@@ -1174,6 +1175,19 @@ also set and if <tt>this-&gt;count() &lt; a.count()</tt>.
Otherwise this function returns false.<br />
<b>Throws:</b> nothing.
<hr />
<pre>
bool <a id=
"intersects">intersects</a>(const dynamic_bitset&amp; a) const
</pre>
<b>Requires:</b> <tt>this-&gt;size() == a.size()</tt><br />
<b>Returns:</b> true if this bitset and <tt>a</tt> intersect.
That is, it returns true if, there is a bit which is set in this
bitset, such that the corresponding bit in bitset <tt>a</tt> is
also set. Otherwise this function returns false.<br />
<b>Throws:</b> nothing.
<hr />
<pre>
size_type <a id = "find_first">find_first</a>() const;

View File

@@ -20,19 +20,13 @@
# define BOOST_OLD_IOSTREAMS
#endif
// this should be in the config system some day
// see http://lists.boost.org/MailArchives/boost/msg62291.php
#define BOOST_DYNAMIC_BITSET_GNUC_VERSION ( (__GNUC__) * 100 * 100 \
+ (__GNUC_MINOR__) * 100)
// no-op function to workaround gcc bug c++/8419
//
namespace boost { namespace detail {
template <typename T> T make_non_const(T t) { return t; }
}}
#if defined(__GNUC__) && BOOST_WORKAROUND(BOOST_DYNAMIC_BITSET_GNUC_VERSION, \
BOOST_TESTED_AT(30300))
#if defined(__GNUC__)
# define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) \
(boost::detail::make_non_const(expr))
#else

View File

@@ -54,7 +54,7 @@ class dynamic_bitset
// of VC++ are likely able to digest a more drinking form of the
// code; but changing it now is probably not worth the risks...]
BOOST_STATIC_ASSERT(detail::dynamic_bitset_impl::allowed_block_type<Block>::value);
BOOST_STATIC_ASSERT((bool)detail::dynamic_bitset_impl::allowed_block_type<Block>::value);
public:
typedef Block block_type;
@@ -476,24 +476,18 @@ BOOST_DYNAMIC_BITSET_PRIVATE:
};
#if defined(__IBMCPP__) && BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
#if !defined BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// Workaround for IBM's AIX platform.
// See http://comments.gmane.org/gmane.comp.lib.boost.user/15331
//
// NOTE:
// The compiler is actually right, until core issue 454 will be settled:
// <http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#454>
//
// It's arguable whether we want to mark this with BOOST_WORKAROUND or not.
template<typename Block, typename Allocator>
dynamic_bitset<Block, Allocator>::block_width_type const
template <typename Block, typename Allocator>
const typename dynamic_bitset<Block, Allocator>::block_width_type
dynamic_bitset<Block, Allocator>::bits_per_block;
template<typename Block, typename Allocator>
dynamic_bitset<Block, Allocator>::block_width_type const
template <typename Block, typename Allocator>
const typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::npos;
template <typename Block, typename Allocator>
const typename dynamic_bitset<Block, Allocator>::block_width_type
dynamic_bitset<Block, Allocator>::ulong_width;
#endif
@@ -676,7 +670,7 @@ resize(size_type num_bits, bool value) // strong guarantee
if (value && (num_bits > m_num_bits)) {
const size_type extra_bits = count_extra_bits();
const block_width_type extra_bits = count_extra_bits();
if (extra_bits) {
assert(old_num_blocks >= 1 && old_num_blocks <= m_bits.size());
@@ -1005,20 +999,26 @@ dynamic_bitset<Block, Allocator>::count() const
using detail::dynamic_bitset_impl::access_by_blocks;
using detail::dynamic_bitset_impl::value_to_type;
#if BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ == 3) && (__GNUC_PATCHLEVEL__ == 3)
// NOTE: Explicit qualification of "bits_per_block"
// breaks compilation on gcc 4.3.3
enum { no_padding = bits_per_block == CHAR_BIT * sizeof(Block) };
#else
// NOTE: Explicitly qualifying "bits_per_block" to workaround
// regressions of gcc 3.4.x
const bool no_padding =
enum { no_padding =
dynamic_bitset<Block, Allocator>::bits_per_block
== CHAR_BIT * sizeof(Block);
== CHAR_BIT * sizeof(Block) };
#endif
const bool enough_table_width = table_width >= CHAR_BIT;
enum { enough_table_width = table_width >= CHAR_BIT };
const bool mode = (no_padding && enough_table_width)
enum { mode = (no_padding && enough_table_width)
? access_by_bytes
: access_by_blocks;
: access_by_blocks };
return do_count(m_bits.begin(), num_blocks(), Block(0),
static_cast<value_to_type<mode> *>(0));
static_cast<value_to_type<(bool)mode> *>(0));
}