I compiled the Boost C++ libraries as follows:
bjam install variant=release link=static threading=multi runtime-link=static
No errors. Then I compiled the following source:
#include <boost/thread/thread.hpp>
#include <iostream>
#define BOOST_THREAD_NO_LIB
void hello() {
std::cout << "Hello world, I'm a thread!" << std::endl;
}
i...
What would be a good way to use Boost in a small team (< 10 people) and lower the time between joining the team and building the application as much as possible. I basically want a workflow like this...
Set up the TFS with the new person's username + password.
Have them log into the TFS from Visual Studio.
Check out the team project (w...
I am trying to remove short strings from a vector.
std::vector<std::string> vec;
// ...
vec.erase(std::remove_if(vec.begin(),
vec.end(),
boost::bind(std::less<size_t>(),
boost::bind(&std::string::length, _1),
5),...
Hi all, I'm trying to use boost::normal_distribution in order to generate a normal distribution with mean 0 and sigma 1.
The following code doesn't work as some values are over or beyond -1 and 1 (and shouldn't be). Could someont point out what I am doing wrong?
#include <boost/random.hpp>
#include <boost/random/normal_distribution.hpp...
I am relatively new to cMake, and I'm trying use the boost asio library in my project.
I was able to get cMake to find other boost libraries such as smart_ptr and lexical_cast, but I get a linker error when I try to include boost/asio.hpp:
LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-1_40.lib'.
I then tr...
hi
I am trying to implement certain matrix operations but I am lost in the internals of ublas library. is there a resource such as tutorial or an example on how to implement new ublas matrix expressions?
Thanks
...
I've checked the examples in the Boost website, but they are not what I'm looking for.
To put it simple, I want to see if a number on a die is favored, using 600 rolls, so the average appearances of every number (1 through 6) should be 100.
And I want to use the chi square distribution to check if the die is fair.
Help!, how would I d...
I have a problem with boost::interprocess::string in shared memory.
When I use a shared_memory_object I can manipulate a structure with different fields, BUT strings (I get a segmentation fault).
On the other side, when I use managed_shared_memory everything is fine.
Am I doing something wrong? Do you know if there is a performance...
It's been a while I coded in C/C++, and now I need its efficiency for a project I'm doing.
What I understand from this shared_ptr is that it basically deletes the object when I need it to. So, if, for example, my object has a vector of shared_ptr, I wouldn't have to worry about iterating through the vector and deleting each element in t...
I'm not very sure about this and I can't seem to find a complete answer. Some of boost's libraries need to be compiled (thread for example, as well as date time for some uses) - obviously one needs to compile them separately on each platform.
What I am interested in is if the hpp files can be shared between platforms. I'm ultimately se...
I had a
HashMap<Node, Double>
in Java which I'd use later on to retrieve the double associated with a node. I've tried to do
boost::unordered_map<Node*, double>
but I get a "error C2108: subscript is not of integral type" when I try to put something in it, like:
map[some_node] = some_double;
If I interpreted the error right,...
Hello,
Using boost build, if I can link to a boost python library with this in my jamfile:
project myProject : requirement
/boost/python//boost_python ;
how can I link to boost test? I have built the boost test library.
I don't want to use file paths since my code is portable. Thanks...
I'm writing a game and an accompanying engine in C++. The engine relies heavily on automation using a simple embedded scripting language. Scripts can create object classes, define event listeners on them, and produce instances from them. At present, an instance must be bound to a script-global identifier in order to preserve its existenc...
Hello,
I have following XML generated by serializing a boost::posix_time::ptime structure. I want to create a Java Date object with this XML.
<timeStamp class_id="0" tracking_level="0" version="0">
<ptime_date class_id="1" tracking_level="0" version="0">
<date>20100119</date>
</ptime_date>
<ptime_time_duration class...
I know they can be used together, but I'm wondering whether it's possible to replace Qt's signals and slots mechanism with Boost.Signal in the Qt parts of the program (widgets and such).
Anyone ever try it? Any gotchas?
Assuming I don't use any other MOC features and replace signals/slots with boost.signal, is it possible to do without...
I am going to start a new C++ project that will rely on a series of libraries, including part of the Boost libraries, the log4cxx or the google logging library - and as the project evolves other ones as well (which I can not yet anticipate).
It will have to run on both 32 and 64 bit systems, most probably in a quite diverse Linux enviro...
Hi I am using boost/1.41.0, and the following code give me compilation error when I try to deserialize a shared_ptr. The serialize part it compiled successfully. Can someone advise me if this is a bug in my code or a general issue for boost? Thanks.
Yanchao
#include <iomanip>
#include <iostream>
#include <cstddef> // NULL
#include <fst...
hello
I have searched the web but could not find an answer.
how do I have set base index in the matrix, such that indexes start from values other than zero? for example:
A(-3:1) // Matlab/fortran equivalent
A.reindex(-3); // boost multi-array equivalent
thanks
...
Hi, I find boost::foreach very useful as it saves me a lot of writing. For example, let's say I want to print all the elements in a list:
std::list<int> numbers = { 1, 2, 3, 4 };
for (std::list<int>::iterator i = numbers.begin(); i != numbers.end(); ++i)
cout << *i << " ";
boost::foreach makes the code above much simplier:
std::li...
I would like to write a method in my test suite
as follows:
void checkParams(arg1, arg2, arg3)
{
BOOST_REQUIRE(arg1==1);
BOOST_REQUIRE(arg2==2);
BOOST_REQUIRE(arg3==3);
}
However, I want to write something to stderr if the assert fails. For example,
if the first assert fails, I want to write:
checkParams failed with arguments arg1=5...