[Boost-bugs] [Boost C++ Libraries] #8135: [lockfree] compile time capacity difference behavior

Subject: [Boost-bugs] [Boost C++ Libraries] #8135: [lockfree] compile time capacity difference behavior
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-21 10:22:16


#8135: [lockfree] compile time capacity difference behavior
-------------------------------------------------------+--------------------
 Reporter: Akira Takahashi <faithandbrave@…> | Owner: timblechmann
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lockfree
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
-------------------------------------------------------+--------------------
 http://lists.boost.org/boost-users/2013/02/77649.php

 I confused with boost::lockfree::queue behavior.

 Fist, run-time capacity:
 {{{
 #include <iostream>
 #include <boost/lockfree/queue.hpp>

 int main()
 {
     boost::lockfree::queue<int, boost::lockfree::fixed_sized<true>>
 que(3);

     std::cout << std::boolalpha;

     std::cout << que.push(1) << std::endl; // true
     std::cout << que.push(2) << std::endl; // true
     std::cout << que.push(3) << std::endl; // true
     std::cout << que.push(4) << std::endl; // false
 }
 }}}
 I think this behavior is correct.

 But, compile-time capacity:
 {{{
 #include <iostream>
 #include <boost/lockfree/queue.hpp>

 int main()
 {
     boost::lockfree::queue<int, boost::lockfree::capacity<3>> que;

     std::cout << std::boolalpha;

     std::cout << que.push(1) << std::endl; // true
     std::cout << que.push(2) << std::endl; // true
     std::cout << que.push(3) << std::endl; // false : why?
     std::cout << que.push(4) << std::endl; // false
 }
 }}}

 Is this bug or specification?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8135>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC