In the boost::shared_ptr destructor, this is done:
if(--*pn == 0)
{
boost::checked_delete(px);
delete pn;
}
where pn is a pointer to the reference counter, which is typedefed as
shared_ptr::count_type -> detail::atomic_count -> long
I would have expected the long to be volatile long, given threaded usage and the non-atomic ...
In the stdint.h (C99), boost/cstdint.hpp, and cstdint (C++0x) headers there is, among others, the type int32_t.
Are there similar fixed-size floating point types? Something like float32_t?
...
I'm testing boost::thread on a system. It happens that I needed to act as a fork(), because one thread modifies the other variables, even member variables of class
I do the project using fork() or is there some alternative still using boost::thread?
Basically I run this program in Linux and maybe FreeBSD.
It is an http proxy,accept() ...
Hello,
I'm trying to use the Gamma distribution from boost::math but it looks like it isn't possible to use it with boost::variate_generator. Could someone confirm that? Or is there a way to use it.
I discovered that there is a boost::gamma_distribution undocumented that could probably be used too but it only allows to choose the alpha...
I am using C++ boost's dynamic_bitset.
I have already allocated a variable and I just want to change its value - to construct it anew from an 'unsigned long' like from the constructor, but I don't want to allocate the memory again or to create a temporary variable.
What can I do?
...
Trying to build sslsniff on a RHEL 5.2 system here. When compiling sslsniff on RHEL I hit the same errors when using libboost packages (from repositories like rpmforge) and compiling libboost from source (which appeared to be successful.) I tried this on a fresh system as well (no previous/failed/garbage installs of libboost etc.)
# mak...
I want to create a mapped binary file into memory; however I am not sure how to create the file to be mapped into the system. I read the documentation several times and realize there are 2 mapped file implementations, one in iostream and the other in interprocess.
Do you guys have any idea on how to create a mapped file into shared mem...
I have a set of shared pointers:
std::set<boost::shared_ptr<T>> set;
And a pointer:
T* p;
I would like to efficiently remove the element of set equal to p, but I can't do this with any of the members of set, or any of the standard algorithms, since T* is a completely different type to boost::shared_ptr<T>.
A few approaches I can t...
#include <iostream>
#include <algorithm>
#include <vector>
#include <boost/array.hpp>
#include <boost/bind.hpp>
int main() {
boost::array<int, 4> a = {45, 11, 67, 23};
std::vector<int> v(a.begin(), a.end());
std::vector<int> v2;
std::transform(v.begin(), v.end(), v2.begin(),
boost::bind(std::multiplies<int>(), _1, 2));
st...
Hello, I would like to pass the multiple arguments with positive or negative values.
Is it possible to parse it?
Currently I have a following initialization:
vector<int> IDlist;
namespace po = boost::program_options;
po::options_description commands("Allowed options");
commands.add_options()
...
I have this very simple C++ class:
class Tree {
public:
Node *head;
};
BOOST_PYTHON_MODULE(myModule)
{
class_<Tree>("Tree")
.def_readwrite("head",&Tree::head)
;
}
I want to access the head variable from Python, but the message I see is:
No to_python (by-value) converter found for C++ type: Node*
From w...
I have a class templated on <PIXEL>, assumed to be one of boost::gil's pixel types (for now, only either gray8_pixel_t or gray16_pixel_t, and I only expect to support homogeneous pixel types e.g rgb8_pixel_t in future).
The class needs to get hold of unsigned char or unsigned short as appropriate to the pixel type; I assume this is buri...
I'm trying to write some c++ code that tests if a string is in a particular format. In this program there is a height followed by some decimal numbers:
for example
"height 123.45" or "height 12" would return true but
"SomeOtherString 123.45" would return false.
My first attempt at this was to write the following:
string action;
cin >> ...
I am trying to use Boost::Fusion (Boost v1.42.0) in a personal project. I get an interesting error with this code:
#include "boost/fusion/include/sequence.hpp"
#include "boost/fusion/include/make_vector.hpp"
#include "boost/fusion/include/insert.hpp"
#include "boost/fusion/include/invoke_procedure.hpp"
#include "boost/fusion/include/mak...
We have started using the boost unit testing library for a large existing code base, and I have run into some trouble with unit tests incorrectly passing, seemingly due to the reuse of memory on the stack.
Here is my situation:
BOOST_AUTO_TEST_CASE(test_select_base_instantiation_default)
{
SelectBase selectBase();
BOOST_CHEC...
Hi ALL,
I have the following error when I try to compile my code in g+ compiler using eclipse
In function `ZSt19__iterator_categoryIPKSsENSt15iterator_traitsIT_E17iterator_categoryERKS3_':
C:/Program Files (x86)/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_algobase.h:(.text$_ZN5boost11basic_regexIcNS_12reg...
I have a data set with N samples (say, 13, 16, 17, 20) where each next sample is incremented by some value (3, 1, 3 in this case) and I want to find various statistics of the second sequence .
Samples are timestamps that are collected incrementally (i.e. not all samples are available at once), hence I want to use boost::accumulators::ac...
Why is the boost::fast_pool_allocator built on top of a singleton pool, and not a separate pool per allocator instance? Or to put it another way, why only provide that, and not the option of having a pool per allocator? Would having that be a bad idea?
I have a class that internally uses about 10 different boost::unordered_map types. If...
I've been having serious problems trying to set up boost. I must have installed and uninstalled the libraries a dozen times. In my most recent attempt, I followed these instructions:
Download the zip and unzip it.
Get the prebuilt jam executable and unzip it. Put that directory in your path.
(Edit Path by using Control Panel...System.....
I try to create a multi-threaded singleton pattern class.
Header:
class HL{
public:
static HL* getInstance();
.........
private:
static HL* instance;
static boost::once_flag flag;
HL();
static void initOnce();
}
CPP:
HL* HL::instance = NULL;
HL* HL::getInstance(){
if(instance...