public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Add noexcept and constexpr to tr2/dynamic_bitset.
       [not found]   ` <CAH6eHdSDoUqW8RJmRVoWATCc1EjcKNsqzrNtvJ9m-LCUwW3y=g@mail.gmail.com>
@ 2012-06-25 16:11     ` Ed Smith-Rowland
  0 siblings, 0 replies; only message in thread
From: Ed Smith-Rowland @ 2012-06-25 16:11 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

On 06/24/2012 07:18 AM, Jonathan Wakely wrote:
> On 24 June 2012 12:18, Jonathan Wakely wrote:
>> On 24 June 2012 05:00, Ed Smith-Rowland wrote:
>>> Subject says it.
>>>
>> This looks good, please CC gcc-patches with a changelog entry and
>> confirmation it was tested and it can go in. Thanks.
> And don't forget to update the copyright year.
>

Built and tested on x86_64-linux-gnu.


[-- Attachment #2: CL_dynamic_bitset --]
[-- Type: text/plain, Size: 146 bytes --]

2012-06-25  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/tr2/dynamic_bitset (count, size, num_blocks, empty, max_size):
	Add noexcept.


[-- Attachment #3: patch_dynamic_bitset --]
[-- Type: text/plain, Size: 2464 bytes --]

Index: include/tr2/dynamic_bitset
===================================================================
--- include/tr2/dynamic_bitset	(revision 188848)
+++ include/tr2/dynamic_bitset	(working copy)
@@ -1,6 +1,6 @@
 // TR2 <dynamic_bitset> -*- C++ -*-
 
-// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -146,19 +146,19 @@
       { return this->_M_w.get_allocator(); }
 
       static size_type
-      _S_whichword(size_type __pos)
+      _S_whichword(size_type __pos) noexcept
       { return __pos / _S_bits_per_block; }
 
       static size_type
-      _S_whichbyte(size_type __pos)
+      _S_whichbyte(size_type __pos) noexcept
       { return (__pos % _S_bits_per_block) / __CHAR_BIT__; }
 
       static size_type
-      _S_whichbit(size_type __pos)
+      _S_whichbit(size_type __pos) noexcept
       { return __pos % _S_bits_per_block; }
 
       static block_type
-      _S_maskbit(size_type __pos)
+      _S_maskbit(size_type __pos) noexcept
       { return (static_cast<block_type>(1)) << _S_whichbit(__pos); }
 
       block_type&
@@ -333,7 +333,7 @@
       }
 
       size_type
-      _M_size() const
+      _M_size() const noexcept
       { return this->_M_w.size(); }
 
       unsigned long
@@ -1141,28 +1141,29 @@
 
       /// Returns the number of bits which are set.
       size_type
-      count() const
+      count() const noexcept
       { return this->_M_do_count(); }
 
       /// Returns the total number of bits.
       size_type
-      size() const
+      size() const noexcept
       { return this->_M_Nb; }
 
       /// Returns the total number of blocks.
-      size_type num_blocks() const
+      size_type
+      num_blocks() const noexcept
       { return this->_M_size(); }
 
       /// Returns true if the dynamic_bitset is empty.
       bool
-      empty() const
+      empty() const noexcept
       { return (this->_M_Nb == 0); }
 
       /// Returns the maximum size of a dynamic_bitset object having the same
       /// type as *this.
       /// The real answer is max() * bits_per_block but is likely to overflow.
-      /*constexpr*/ size_type
-      max_size() const
+      constexpr size_type
+      max_size() noexcept
       { return std::numeric_limits<block_type>::max(); }
 
       /**

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-25 15:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4FE690E2.8040001@verizon.net>
     [not found] ` <CAH6eHdTYfYWouLb8bF21mBDX3LeXZQsbvRyNrjSAcYA-dKDVxw@mail.gmail.com>
     [not found]   ` <CAH6eHdSDoUqW8RJmRVoWATCc1EjcKNsqzrNtvJ9m-LCUwW3y=g@mail.gmail.com>
2012-06-25 16:11     ` Add noexcept and constexpr to tr2/dynamic_bitset Ed Smith-Rowland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).