Hi,
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?


Thanks,
Akira

>>========================
Akira Takahashi
mailto:faithandbrave@gmail.com
site: https://sites.google.com/site/faithandbrave/about/en