I am trying to develop a simple SSL client-server application using boost::asio. I have downloaded, compiled and run the boost example for ssl client-server. Nevertheless, in the mentioned example, a certificate must be provided to the client as file
I am looking for a way to model a tree with an arbitrary amount of childrens per nodes. This answer suggests using the Boost Graph Library for this task: What's a good and stable C++ tree implementation? The main operations that I need to perform are
Trying to understand where the scope exit blocks would execute with respect to automatic variables' deallocations, I wrote this program: #include <boost/scope_exit.hpp> #include <iostream> class A { public: A() { std::cout << "A's c
Trying to save one iteration over my vector. I have a vector<T> I need to find a minimum element in the vector. I am using std::min_element. Now there is a requirement to create a custom structure, which has elements of <T> plus few extra, com
I come from C# coding experience; I am beginning to learn C++ and make use of boost libraries for threading. I wrote the following class - trying to execute a member function as a thread. Writing the following simple code, i would expect the while lo
I have a vector of strings with a size of 10. I want to join it to a string from index 3 to 6 with space as delimiter. I know boost::algorithm::join could do it with the whole vector, but I want something that does it on a specific range with minimal
I have been using boost for a while but am still a novice. I think I fall for boost::any as I don't need to use template much anymore to handle typed objects used or returned. Yet one thing I find it still inconvenient to me is a smoother function or
I am using boost::filesystem to search and process files in a directory. But instead of processing every file (checked by using boost::filesystem::is_regular_file()) I want to only process text files (or at least ignore binary files). Is there a way
I'm trying to use cpp-netlib with Visual Studio 2010. I've built cpp-netlib and add .lib files to my project, but I can't compile them. --Environment Windows 7 x64 cpp-netlib 0.11.0 boost 1.55.0 Win32 OpenSSL v1.0.1f My code is here. #include <boost/
I am trying to make a CMake project for code that uses Boost libraries. I want to build it for Android, and I am using this project as a reference: https://code.google.com/p/android-cmake/. I want to use Boost static libraries that I previously built
In my application I have a number of classes that I want to be able to serialize. So each class whose instances need to be serializeable has the following: friend class boost::serialization::access; template<class Archive> void serialize(Archive&
I don't understand how I can play sound with OpenAL library. I write program for VoIP. I'm getting every 10ms sound buffer. size_t len = socket.read_some(boost::asio::buffer(buf),error); buf is boost::array <char, 441> buf; And that I need to do wit
I am trying to use a boost random generator to make random points uniformly distributed over a plane surface. I have the following link for doing it in a single dimension: Boost random number generator Here they use boost::uniform_int<> to generate
In visual studio 2010, I get Error 1 error LNK2019: unresolved external symbol "public: __thiscall Server::Server(class boost::asio::io_service &)" (??0Server@@
[email protected][email protected]@boost@@@Z) referenced in the function _main C:\Users\Lucie
I have a class scene like this: class Renderer; class Scene { public: Scene(const std::string& sceneName); ~Scene(); void Render(Renderer& renderer); Camera& GetSceneCamera() const; SceneNode& GetRootNode() const; const std::string& Ge
I'm using Boost to do some matrix algebra. I'm trying to understand if this optimization does anything. Original: matrix<double> DoSomething(matrix<double> a, matrix<double> b) { return a + b; //for example } Optimization: matrix<doub
I need a data structure, and I'm unsure of what to choose. Fundamentally, my need is similar to std::set, except I need to look up according to multiple different comparators over the same data at the same time. Right now I've decided to go for some
I have a class which derives from enable_shared_from_this and a method which returns a shared pointer by calling shared_from_this(). I would like to in that method detect if the object is owned by a shared_ptr and if not throw. I tried something like
in a function, which "return" would be more appropriate? A. vector<Foo> ? B. shared_ptr<vector<Foor>> ? In other words, which copy is less heavy, what would you do, and why?I think returning shared_ptr<vector<T>> ra
I'm using a boost::multi_index_container to provide a random access and a hash-based access to a collection of elements. I wanted to change the random access index of an element, without changing the hash-based index. Here is a piece of code : # incl
I would like to pass a lambda to a funciton. This boost::function<void()> fncPtr(boost::bind<void>([](){/* something */})); works, but if the lambda had a parameter, I don't know how to do it properly: boost::function<void(bool)> fncPtr(
I would like to encapsulate a signals2::signal object ans expose the connect and operator() functions, but how does their prototypes look like? Example: #include <boost/signals2/signal.hpp> template<typename T> class A { public: typedef boost:
I'm attempting to create a list of objects using the variant boost. #include <string> #include <list> #include <iostream> #include <boost/variant.hpp> using namespace std; using namespace boost; class CSquare; class CRectangle { pu
How can I iterate over a tuple starting from, say, index 1 to 2? The following doesn't work. using boost::fusion::cons; typedef cons<A, cons<B, cons<C, cons<D> > > > MyTuple; MyTuple tuple_; template <class T> struct DoSometh
Aside from catching the bad_weak_ptr error thrown when trying to call shared_from_this() on a pointer that is a raw pointer, is there a way of testing whether or not the object is being reference counted? I have functions that deal with the raw point
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
Does anyone know if there is a good way to turn a boost::posix_time::ptime into an __int64 value. (I have compiled the microsecond version, not the nanosecond version). I need to do this somehow as I am looking to store the resulting __int64 in a uni
I'm aware that each process creates it's own memory address space, however I was wondering, If Process A was to have a function like : int DoStuff() { return 1; } and a pointer typedef like : typedef int(DoStuff_f*)(); and a getter function like : Do
I want to do the following: Define a map between a string and any kind of object (may be a list, integer - anything). The keys to the map can be as follow (the values are, again, not important): "AAA/123" ==> 1 "AAA/" ==> 2 "
I have just started using Boost 1.36. These libraries would be very useful in reducing the amount of code needed in the unmanaged C++ software project that I am working on. However when I tried to used these libraries my compile times increased ten f