boost

getting a normal ptr from shared_ptr ?

i have something like shared_ptr t(makeSomething(), mem_fun(&Type::deleteMe)) i now need to call C styled func that require a pointer to Type. How do i get it from shared_ptr? ...

How do I zip a directory of files using C++?

I'm working on a project using C++, Boost, and Qt. I understand how to compress single files and bytestreams using, for example, the qCompress() function in Qt. How do I zip a directory of multiple files, including subdirectories? I am looking for a cross-platform (Mac, Win, Linux) solution; I'd prefer not to fire off a bunch of new pr...

How to call a python function from a foreign language thread (C++)

Hi, I am developing a program that use DirectShow to grab audio data from media files. DirectShow use thread to pass audio data to the callback function in my program, and I let that callback function call another function in Python. I use Boost.Python to wrapper my library, the callback function : class PythonCallback { private: ...

raw function pointer from a bound method

I need to bind a method into a function-callback, except this snippet is not legal as discussed in demote-boostfunction-to-a-plain-function-pointer. What's the simplest way to get this behavior? struct C { void m(int x) { (void) x; _asm int 3; }}; typedef void (*cb_t)(int); int main() { C c; boost::function<void (int x...

boost asio and endian

I cant tell, does boost asio handle endian? ...

how boost::function and boost::bind work

I dislike haveing magic boxes scattered all over my code...how exactly do these two classes work to allow basicly any function to be mapped to a function object even if the function<> has a completly diffrent parameter set to the one im passing to boost::bind It even works with diffrent calling conventions (ie member methods are __thisc...

Is it possible to use boost library in visual studio 2008 64 bit version?

I tried to use boost library in 64 bit mode of VS2008 but I'm getting "header file not found" errors. is it any possible to use boost library under 64 bit mode of VS2008? it worked fine in 32 bit mode. that's why I'm suspicuous bout 64 but ;( Or anybody have good link to show setting up 64 bit mode to use boost? thanks ...

using C++ boost regex

Hi, I am not an expert in boost, though I have used ublas extensively. Recently, my supervisor asked me to build boost regex for the gcc platform. My question is: Why can't I use the regex as it is, like ublas? Please give detailed answer. ...

Using Iterator parsing with Boost::Spirit Grammars

When I attempt to use the iterator form of parsing for a Spirit grammar I get a argument passing conversion error from the iterator type to const char*. How do I fix this? There are some restrictions. I'm using an iterator adapter on large inputs, so it is not feasible for me to convert to a C style string. Here is sample code demons...

Isn't it possible to use 'Repeats' in the lookaheads for boost:regex?

I'm trying to extract some variables in my C++ code nested in blocks for example, if I have DEL_TYPE_NONE, DEL_TYPE_DONE, DEL_TYPE_WAIT, I'd like to match "DEL_TYPE_NONE" "DEL_TYPE_DONE" "DEL_TYPE_WAIT" I made my pattern like this, std::string pat("(?<=^[ \\t]?)[A-Z0-9_]+(?=,$)"); but I'm keep getting error message when compil...

Return an array by looking up bits?

I have the following use case , array of integers vector<int> containing elements 123 345 678 890 555 ... pos 0 1 2 3 4 Based on the bits representation I receive for e.g 101 then return 123 678 (Elements of the array with its position bits set) 0011 then return 678 890 00001 then retur...

boost::asio::serial_port reading after reconnecting Device

I have a problem with the boost::asio::serial_port class reading from a GPS device (USB-Serial). Connecting the device and reading from it works fine, but when I disconnect and reconnect the device, read_some doesn't read any bytes from the port. As boost doesn't seam to detect that the serial port is gone ( is_open() returns true ), I ...

Using Boost Tokenizer escaped_list_separator with different parameters

Hello i been trying to get a tokenizer to work using the boost library tokenizer class. I found this tutorial on the boost documentation: http://www.boost.org/doc/libs/1 _36 _0/libs/tokenizer/escaped _list _separator.htm problem is i cant get the argument's to escaped _list _separator("","",""); but if i modify the boost/tokenizer.hpp...

Simple boost submissions; advice?

Looking for some general advice... I've been using boost for a while, and I've written several small modules and function (eg: see this SO question) which I think cold be appropriate for inclusion in boost. I've been to the project pages to see about the submission process, but it seems like it's "be on the inside, or don't bother". I c...

In the C++ Boost libraries, why is there a ".ipp" extension on some header files

In the C++ Boost libraries, why is there a ".ipp" extension on some header files? It seems like they are header files included by the ".hpp" file of the same name. Is this convention common outside of Boost? What is the justification for having a special file type? ...

Linking to Boost.Signals using Xcode

I can't for the life of me get Xcode to link to Boost.Signals properly. I've built Boost using MacPorts, and I even went as far as downloading Boost myself and manually building it. I've set the Library Search Paths to include /opt/local/lib, and I've added "-lboost_signals-mt" to the Other Linker Flags. I've tried dragging and dropping...

boost:thread - compiler error

Hello, I wanted to use boost::thread in my program, but get the follwing compiler error (Visual Studio 2005): Error 1 error C2064: term does not evaluate to a function taking 0 arguments d:...\boost_1_37_0\boost\thread\detail\thread.hpp 56 Therefore I tried to recreate the problem in a small program and modified the working Hello Wor...

Should I become proficient with STL libraries before learning BOOST alternatives?

Does it make sense to restrict yourself to the STL libraries when learning C++ and then tackle boost and its additions after you have become fairly proficient with vanilla C++? Or should you dive right into BOOST while learning C++? ...

Speed up Rails App on development env.?

Hi. I have huge Rails app on development right now, which run VERY slow on -e development. I use Mongrel as web server. Is there any way to speed up a little bit everything? Because i have to wait 3-10 sec. to reload a page. Thanks. ...

Can`t really understand what the parameters for constructing tcp::resolver::query

Hi everybody, I am starting Boost.Asio and trying to make examples given on official website work. here`s client code: using boost::asio::ip::tcp; int _tmain(int argc, _TCHAR* argv[]) { try { boost::asio::io_service io_service; tcp::resolver resolver(io_service); tcp::resolver::query query(argv[1], "daytime"); ...