Is there a way to transfer a new class instance (python class that inherits c++ class) into c++ with out having to hold on to the object return and just treat it as a c++ pointer.
For example:
C++
object pyInstance = GetLocalDict()["makeNewGamePlay"]();
CGEPYGameMode* m_pGameMode = extract< CGEPYGameMode* >( pyInstance );
pyth:
cla...
Hi,
I'm using adjacency_list< vecS, vecS, bidirectionalS ... >
extensively. I have so many graphs loaded at once that memory
becomes an issue. I'm doing static program analysis and store the
callgraph and flowgraphs of the disassembled binary in boost graphs.
Thus I can have several ten thousand functions==flowgraphs and one
gigantic ca...
Hi,
I am installing boost library from its source boost_1_40_0.tar.bz2 on my Ubuntu 8.10. Following "./bootstrap.sh --prefix=path/to/installation/prefix" and "./bjam install", the compilation is very intensive and my system seems unable to take the burden and abnormally exits. I tried several times. All end in my system aborting. Everyti...
Hello,
I'm having trouble choosing between Boost.Any and Boost.Variant.
When should I use each one?
What are the advantages and disadvantages of each?
I am basically looking to store some states from external sources.
Thanks,
Omer
...
Hi experts,
The following codes compiled and linked fine with g++-4.0 on a Mac OSX
for_each(As.begin(), As.end(),
boost::lambda::if_then(
boost::lambda::bind(&A::get_string, boost::lambda::_1)==" CA ",
boost::lambda::bind(&std::list<A>::push_back, &As_copy, boost::lambda::_1)
)
);
But when I try to populate a conta...
Hi all,
I can't seem to find boost::lambda::ll for a nested ll::for_each() invocations in any header file in the boost_1_39_0 distribution. Could someone point me to the right direction? Thanks.
...
Hi Everyone
I'm trying to make a boost::multi_index container that uses member functions w/ parameters as keys.
class Data {
public:
std::string get(const std::string & _attr) { return _internals_fetch_data(_attr); }
/*
assume some implementation for storing data in some structure(s)
*/
};
Suppose I have a rectangular list of ...
I am writing a routine to compare two files using memory-mapped file. In case files are too big to be mapped at one go. I split the files and map them part by part. For example, to map a 1049MB file, I split it into 512MB + 512MB + 25MB.
Every thing works fine except one thing: it always take much, much longer to compare the remainder (...
I am using boost shared pointers in my program, and I have a class that takes as a parameters a reference to another object. The problem I am running into is the make_shared function requires all parameters to be a const reference, and I get compile errors if my class's constructor doesn't allow const reference parameters to be passed i...
Can someone please show a simple, but complete example of how one could use Boost exception library to transfer exceptions between thread by modifying the code below?
What I'm implementing is a simple multi-threaded Delegate pattern.
class DelegeeThread
{
public:
void operator()()
{
while(true)
{
// Do some work
...
Just a conceptual question that I've been running into. In my current project it feels like I am over-using the boost smart_ptr and ptr_container libraries. I was creating boost::ptr_vectors
in many different objects and calling the transfer() method to move certain pointers from one boost::ptr_vector to another.
It is my understandin...
I've been trying to get the boost library working with Code::Blocks and am having some trouble.
When I first tried to get boost, all I did was download the latest zip file and extract it into the CodeBlocks folder. Then I set the compiler settings to look in the boost folder. This allowed me to compile, but not to link. I then read the ...
I have a boost::bimap and I want to iterate over all positions
to add the values of the given side to another STL-compatible container.
How can I do this?
My approach was to use std::for_each together with boost::bind:
std::for_each(mybimap.left.begin(),
mybimap.left.end(),
boost::bind(&vector::push_back, &m...
On HPUX I need to use the +h link option to get the boost 1.39.0 shared libraries to contain correct paths.
-Wl,+h$(SPACE)-Wl,$(<[-1]:D=)
(From http://www.nabble.com/HPUX-aCC:-Howto-avoid-building-boost-libraries-containing-absolute-library-path-references-when-calling-bjam-install-td17619511.html)
I've tested that this works by hack...
After reading this answer I thought I had a solution. At least the answer there is what I would like to do but I'm having a problem with the implementation.
here is an outline of what I am trying to do
typedef map<string, double*> myMap;
typedef int (*ftwpt)(const char*, const struct stat*, int);
typedef boost::function<int(const char...
Hey there,
I've just been experimenting with the boost::function_types library recently, and I've come across a bit of a snag. I want to find out the calling convention of a given function, however I'm not quite sure how to do this. Here's what I have so far:
This produces an error about how it cannot find the *_cc tag values inside e...
I'm using the Boost Parameter tutorial to create a named-parameter constructor for a playing card generator. The tutorial says to put the ArgumentPack into a base class, but I want to modify variables in the card generator class. I've thought about doing this:
class CGconstructor_base {
public:
template<class ArgumentPack>
C...
Is it possible to access the arguments contained in a boost::function type?
I'd like to be able to retrieve the address of the function to be called, and the values of the arguments provided for that function.
...
Suppose I have the following code:
int f(int, int);
int main()
{
SomeFunc(boost::bind(f, 1, 2));
}
From the SomeFunc() function, is it possible to access the arguments held by the bound type? Something like this (pseudo code):
// Obvious syntax issues...
void SomeFunc(boost::bind& functor)
{
if(functor.function == &f)
{...
For the last few years, I have been exclusively a C# developer. Previously, I developed in C++ and have a C++ application that I built about 3 years ago using VS2005. It made extensive use of the Boost libraries. I recently decided to brush off the old app and rebuild it in VS2008 with the latest version of Boost (the latest version w...