Click here to Skip to main content
15,889,462 members
Everything / Boost

Boost

Boost

Great Reads

by Martin Vorbrodt
Parsing Command Line Options
by Martin Vorbrodt
Plugins: loading code at runtime
by Dave Ceddia
Frameworks like Vue have the notion of “computed properties” – a way to derive some new, possibly complex data based on something passed in. This post covers how to achieve the same result in React.
by Martin Vorbrodt
How to print stack traces

Latest Articles

by Daniel Ramnath
Reverse proxy developed using BOOST 1.75 asynchronous ASIO calls
by Dominik Reichl
KeePass is a free, open source, light-weight and easy-to-use password manager.
by H_
C++ list comprehension
by DotnetShtien
In this article we will dicuss when new feature added recently to the meta-programming library which is the command contracts.

All Articles

Sort by Updated

Boost 

17 Aug 2021 by Adam Aug2021
I currently have a class that uses a pointer vector to another class. Everything has worked fine until I began implementing boost serialization. On the first run with the program, everything works fine and appears to save the data into the .xml...
17 Aug 2021 by Adam Aug2021
Thanks for the help all. Turns out all I had to do was switch from xml to text (ie. xml_oarchive to text_oarchive). Not sure what happened there but I don't have the time to keep fiddling around with it as the beginning of the semester is closing in.
10 Dec 2014 by Aescleal
For resources that should be shared between other objects and automatically deleted when the last object using that resource is destroyed you use a shared_ptr. If you're using a C++98 compiler then use the implementation from boost or tr1, otherwise use the standard one.You could simplify a...
14 Jun 2011 by Albert Holguin
WaitForSingleO...
13 Nov 2011 by Alex Culea
Hi!Has anyone managed to build Boost with ICU support without requiring any DLLs from ICU bin directory (I'm using VS2010)?Regards
2 Sep 2011 by Alexander Bessonov
A simple high-level IPC library with ability to use native C++ interfaces.
15 Jun 2012 by AlexZakharenko
A more efficient way to create objects for usage with shared_ptr
24 Feb 2011 by Andriy Padalka
Module to dynamically assign, store, and call with handlers different functional objects: functors, functions, member functions.
6 May 2014 by AndyUk06
A non-nonsense guide to setting up Boost threads in Visual Studio environments.
6 Dec 2010 by Apriorit Inc, Elizaveta Golub
This article includes a description of the monitoring process for the session logon/logout, connect/disconnect (regarding terminal and client sessions). Obtained results will be then used in the next article ”Creating process in the session”.
6 Dec 2010 by Apriorit Inc, Elizaveta Golub
This article contains the description of how to start a process in the current active session on session logon notification event with permissions of system process running in the current session.
16 Feb 2012 by Ashish Tyagi 40
You need to create a functor, likestruct Range{ Range(int min, int max): _min(min), _max(max){} bool operator(int value_) { return (_min
8 Aug 2019 by Audiory Researcho
How can I create a minimal Visual Studio Code 2.2 workspace with: 1. C++ library project (if possible *.so - shared library, if not *.a to use with C#) 2. (If required) something instead of C++/CLI wrapper project(it is linux os no MS C++/CLI) may be wrapper on C# side? 3. C# Application...
13 May 2022 by AVLoureiro
I'm trying to compile a C++ tomography code on RH7. I have previously compiled it on Ubuntu 20.04 with some issues that were easily solved by adding missing includes on the original code. I have limited experience with C++ and I'm still not...
13 May 2022 by AVLoureiro
After a few days, I managed to solve this problem. I configured cmake to use another version of g++ available on the system: -DCMAKE_C_COMPILER=/share/apps/gcc/v7.3.0/bin/gcc -DCMAKE_CXX_COMPILER=/share/apps/gcc/v7.3.0/bin/g++ This allowed me...
25 Nov 2016 by BadJerry
In SQL, you can compare successfully two strings depending on the collationWith Latin1_General_CI_AS, fussballmanager and fußballmanager are considered equal. They are different with SQL_Latin1_General_CP1_CI_AS.I am trying to replicate the same behaviour in C++. I understand it's...
31 Mar 2014 by barneyman
The first item in this list[^] appears to what you're after
7 Nov 2023 by bartello
I wrote a very simple chat server using boost::asio. Everything works as it should. As I just redid the TCPSession class to use "strand", there was an error in the functionality of the class: The server accepts a connection and immediately drops...
27 Apr 2014 by Bartlomiej Filipek
This book is a must-have resource for any C++ developer!
30 Mar 2012 by bieren83
I'm trying to implement a simple segregated storage using Boost but having problems using the classes. Here is a test application. It crashes at the two last lines where I try to allocate partitions from the memory pool.Does anyone see a problem here?#include...
26 Jun 2016 by bishopnator29a
Saving, Loading and data migration in compact library
31 Mar 2015 by BrainlessLabs.com
This tip describes a n ary tree structure. We will see how traversal works.
4 Apr 2015 by BrainlessLabs.com
In this tip series, we will create a small C++ game engine.
10 Dec 2014 by C-A-P
I have two classes SslHandshake and SslRequest with according to names functionality.After client and server handshakes are done in the SslHandshake, I pass both sockets to SslRequest and start transferring data from server to client.1. If I is not waiting for finishing of transferring,...
16 Nov 2017 by ChrisB91
Hi,I'm trying to send large files (~4GB) from a http server to some clients. My server implementation is based on Boosts HTTPServer3 Example HTTPServer3.The problem is, that the files are first completely loaded into memory and then send to the Client.I would like to read chunks of about...
5 Feb 2012 by Christian Graus
It can't hurt to remove them.
1 Apr 2013 by cocaf
The pause/resume thread functionality helps to avoid problems caused by invalid memory access and race conditions.
4 Aug 2015 by cocaf
The generic network endpoint (IP address and port) class that can be compared with and cast to/from the protocol aware boost::asio::ip::udp::endpoint and boost::asio::ip::tcp::endpoint objects.
15 Oct 2012 by CPallini
I think blocking the function is not an option (or at least a good option). You should find the flaw in your expression (regular expressions do have pitfalls, see, for instance "Runaway Regular Expressions: Catastrophic Backtracking"[^]).
15 Apr 2014 by CPallini
As suggested, you can easily write your own code for parsing such a simple format (and rewriting it as XML is a good suggestion too). Even Boost.Regex is, in my opinion, overkill for such a format.
10 Aug 2017 by CPallini
Did you try Google? See, for instance, c++ - boost::thread compilation error in Visual Studio 2010 - Stack Overflow[^].
7 Jul 2023 by CPallini
Possibly some insight here: #59384 (boost uses zstd if present) – MacPorts[^].
24 Jun 2015 by cxxxxf
Hi, There are link errors when I compile a simple demo.In function `boost::archive::text_oarchive::text_oarchive(std::basic_ostream >&, unsigned int)':demo.cpp:(.text._ZN5boost7archive13text_oarchiveC2ERSoj[_ZN5boost7archive13text_oarchiveC5ERSoj]+0x25):...
3 Nov 2022 by Daniel Ramnath
Reverse proxy developed using BOOST 1.75 asynchronous ASIO calls
14 Aug 2018 by Dave Ceddia
Frameworks like Vue have the notion of “computed properties” – a way to derive some new, possibly complex data based on something passed in. This post covers how to achieve the same result in React.
18 Mar 2014 by Dave Kreskowiak
If you are naïve enough to ask the question "which class should I use", you don't have the know-how to write such an application.There isn't any "one class" you should use, but lots and lots of them.No, we're not going to walk you through re-writing someone else's crap-ware.
31 Oct 2013 by DigitalInBlue
This seems like it should be trivial, but I'm having problems getting started with Boost Python. I want to make a little demo to work out some issues. The main problem is that I need to have a class with a member function return a shared_ptr to a base type. That base type will almost always...
10 Sep 2013 by Dilan Shaminda
Hi,I am new to boost threads and i have a char type for loop.Inside my for loop i am calling a function which does different operations based on the input char....below is my codechar * letters = "ABCDEFGHIJKLMNOPQRSTUVWXZ"; for (char * ptr = letters; *ptr != 0; ++ptr) { char ch...
28 Jun 2021 by dilsdgr8
My websocket server URL is localhost/webstream/wsocket Iam trying to create a C++ websocket client that connects to this server using boost. tcp::resolver resolver{ioc}; _pws = new websocket::stream(ioc); ...
13 Jan 2020 by Dominik Reichl
KeePass is a free, open source, light-weight and easy-to-use password manager.
9 Sep 2019 by DotnetShtien
In this article we will dicuss when new feature added recently to the meta-programming library which is the command contracts.
2 Jul 2013 by Droperidolum
Hi!I found this patch (link) but didn't tried yet.
21 May 2013 by Dusan Paulovic
Hello, I am trying to find a way to compare unicode strings without accents and case, so for example strings 'áíé' and 'AIE' should be considered equal.I have tried boost::locale, also unicode normalisation, but can not get it working correctly.I think that ICU would work, but my boss does...
9 Nov 2010 by ed welch
Does anyone know of a working visual studio vizualizer for boost unordered_map (that's the thing that goes in autoexp.dat)?
10 Nov 2010 by ed welch
Well, I found an easy solution, since boost unordered_map has identical interface to std::map, I use std::map in debug builds and boost unordered_map in release builds :-D
10 Sep 2013 by Espen Harlinn
Use a barrier[^] - the 'trick' is that all the threads, including the thread that is supposed to do something when the other threads have finished, have to 'pass' the barrier.Best regardsEspen Harlinn
14 Aug 2019 by essentialSQL
Database indexes explained
3 Feb 2013 by Falconapollo
Boost is an excellent library, but sometimes, it's inconvenient to add the whole library. So I want to extract a little part of Boost, only the necessary files are extracted.I know BCP.exe, but it didn't work as expected. BCP.exe extract too many unnecessary files.I work with Visual C++...
3 Jun 2011 by Farier
I have an application that is relying heavily on boost signals2. One issue that I want to address is that I do not want objects to be able to register a member function to a signal twice. Is there a mechanism to enforce that? Looking at the tutorial, I don't really see this kind of...
16 Feb 2012 by Fernando A. Gomez F.
Hi everybody,I'm reading the documentation regarding boost's filter_iterator[^] and I'm trying to use it as follows. I have two classes: employee and catalog. The latter is a container for the former. The container, internaly, uses a std::list to store the data and thus I have full...
18 Feb 2012 by Fernando A. Gomez F.
Hi Ashish,Your solution worked perfectly, with a slight modification. Thank you very much, it really helped a lot. For the record, I'll leave my working program. Now I'll try to make it word with std::function and using lambdas... :-)#include #include #include #include...
1 Nov 2013 by Gabi Barcan
Call methods of an existing class in MFC asynchronously, while still preserving the thread affinity required by MFC and COM.
24 Mar 2011 by ganesh_IT
Hi guys, i am new to boost libraries regular expression.for me its something complicated.I need to separate word form my format.The format is Dear customer {Customer.Customer_Id:D} offer {Offer.Offer_Id:D} From....i need to separate all words and {Customer.Customer_Id:D} as a separate...
27 Feb 2014 by Garth J Lancaster
On windows you would either put libboost_system.so.1.49.0 in the same 'folder' as the compiled (exe) (not a good idea with big distro's like boost), or, make sure the directory where all the boost 'binary'/compiled libs/dlls is/are is on your pathIm not sure how Linux searches for...
14 Apr 2018 by George Shagov
Four Boolean Logic induction
13 Sep 2013 by geoyar
Applying Ant Colony Optimization algorithms to solve the Traveling Salesman Problem.
30 Apr 2016 by grayrain
Regular Expression: (?
17 Aug 2021 by Greg Utas
That's a very generic error that doesn't say why abort was called. But press Retry and use the debugger to find the problem. If you don't know how to use a debugger, Visual Studio has lots of documentation about it. Using a debugger is...
28 Oct 2021 by Greg Utas
You could try creating locals for r.size() and count[r[i]->elo - min], but it probably won't matter if you're using a decent optimizing compiler. There's probably some overhead caused by boost::shared_ptr. A unique_ptr would be slightly faster,...
7 Feb 2013 by H.Brydon
On a 32 bit system, an int is 32 bits and any 'size' value will be determined by this as an upper limit (actually an unsigned int, not a signed int) but you will run into other limits far sooner than that. The 32 bit int (unsigned) also defines address space, and you don't have all of that...
18 Aug 2013 by H.Brydon
You can determine the packet size, and implement a timer so that you don't send any more than 'x' bytes per second by counting manually in your program and watching the timer. If the data you are sending is reasonably large, you can estimate the packet size as roughly the number of payload...
17 Dec 2019 by H_
C++ list comprehension
25 Oct 2011 by hariharansa
Hi all, I am learning boost library for the network programming and i read about boost bind and have some doubts in the following code.boost::asio::async_read_until(socket_, buf, boost::regex("\r\n\r\n"), boost::bind(&connection::handle_read, shared_from_this(), ...
26 Oct 2011 by hariharansa
Hi , i am learing boost for a couple of days and when i tired their "Daytime.3 - An asynchronous TCP daytime server" example from the link http://think-async.com/Asio/boost_asio_1_3_1/doc/html/boost_asio/tutorial/tutdaytime3/src.html[^]it shows the following erro while building :"...
26 Oct 2011 by hariharansa
hi all,I am new to c++ and i would like to know what does the underscores followed by the vaiables name in a constructor of the class, i have a small piece of code like this server::server(ba::io_service& io_service, int thnum, int port) : io_service_(io_service), ...
6 Feb 2019 by IAmJoshChang
How to add the Invincible Power-Up Into The Game
19 Mar 2013 by Igor Stanic
Extending boost::filesystem for Windows and Linux.
19 Mar 2013 by Igor Stanic
Manage Linux Trash and Windows Recycle Bin with C++.
5 Dec 2012 by Im2N00By
Hello,At the moment I have a little design issue. I created proxy server for my application, but I'm having trouble to delete sessions. (using boost::asio)I obviously have two sockets. One connected from proxy to client and one connected from proxy to server. I use async operations to...
14 Jan 2011 by jean Davy
Read/write serialize/unserialize any kind of arbitrary set of C++ data structures in the Registry.
21 Dec 2010 by jean Davy
#include must not be in precompiled header
21 May 2013 by Jochen Arndt
You can try to use WideCharToMultiByte() to convert the strings to ASCII using precomposed characters and compare the converted ASCII strings:char lpszAscii[128];::WideCharToMultiByte(20127, WC_COMPOSITECHECK, L"Dušan áíéúó", -1, lpszAscii, 128, NULL, NULL);int nCompare =...
15 Oct 2015 by Jochen Arndt
You must add the path to the boost libraries at Library Directories in the Directories Properties Page[^].
12 Nov 2015 by Jochen Arndt
It seems that you forgot to add the library file to your project. The file name should be libboost-regex*.lib (* = VC version, single/multi thread, release/debug). Look it up in your boost library directory and add it to your project at Linker - Input - Additional Dependencies (the debug...
25 Nov 2016 by Jochen Arndt
There is a really good answer about string comparison at this SO thread:c++ - How to compare a "basic_string" using an arbitary locale - Stack Overflow[^].Regarding your SQL examples, both should return false for the example strings when using AS (Accent Sensitive). But I'm not quite sure...
19 Dec 2017 by Jochen Arndt
It has been merged into the C++17 standard: std::filesystem::directory_iterator - cppreference.com[^]. If you still want to use the Boost implementation (and not compiling with C++17 support) you must use an older Boost version or check if it is still there but requires a definition to be enabled.
24 Dec 2014 by johnbMA
Hi:I'm currently working on a Microsoft (unmanaged) C++ project which utilitizes Boost C++ libraries. It's been quite a while since I've done C++ and I have noprevious experience using the Boost libraries.We are using Boost 1.55 and MSVC 2013. We used CMake to generate the Visual...
18 Jan 2021 by k5054
As Richard pointed out, you can trap Ctrl-C and then pass a signal to the child to exit gracefully. If you are on linux, and you have the source code to the child process, you can set the Parent Death Signal using prctl(PR_SET_PDEATH_SIG,...
19 Oct 2021 by k5054
At a guess: the strings "test1", "test2", "test3" are all very short and maybe the compiler is smart enough to use a "small string optimization", and ends up comparing 64bit ints rather than doing a string compare. You also have a very small...
11 May 2022 by k5054
Quote: Could this be related to the compiler version? That's quite probable. You might be able to solve it by trying different standard compliance versions. GCC 4.8 compiles by default as C++ 98, you could try setting -std=c++11 for the compile...
22 Dec 2016 by KarstenK
Detecting memory leaks isnt easy, so you need some tools if you really want to do it. I would try at first to contact some people with deep boost knowledege.Sometimes the task manager is fooling at the first look. Read here how to find memory leaks. And if you want to dig deeper you may find...
16 Nov 2017 by KarstenK
Take a look at this answer at stackoverflow. Consider splitting the data into smaller chunks in network packet size multiples to minize sending half empty packets. Multiples of 1024 may fit best.
16 Nov 2017 by KarstenK
Your question is already answered on Stackoverflow.
13 Jan 2022 by KarstenK
The error messages sound like that the struct isnt marshallable and you need to reconfige the interface. My experience from C# to C++ and vice versa is that native interfaces are the best. You better read Calling C or C++ From Python tutorial to...
9 Aug 2016 by Kel_
Presents a serverless real-time HTML5 chat application using emitter.io, vuejs and bootstrap.
30 Apr 2016 by leon de boer
Sergey was close (?
21 Mar 2014 by manishakc
Hi All,I'm trying to serialize shared pointer using boost but it gives error :Error 1 error C4308: negative integral constant converted to unsigned type c:\users\mydirect\future\lib\boost_1_55_0\boost\mpl\print.hpp 51 1 InputSpent more than 2 days on this but no clue.. when i comment...
14 Mar 2019 by Martin Vorbrodt
How to serialize data to XML
16 Mar 2019 by Martin Vorbrodt
How to print stack traces
15 Mar 2019 by Martin Vorbrodt
Blocking queue
19 Mar 2019 by Martin Vorbrodt
Plugins: loading code at runtime
21 Mar 2019 by Martin Vorbrodt
Parsing Command Line Options
29 Mar 2019 by Martin Vorbrodt
How to use cURLpp (C++ wrapper around libcURL) to make a simple HTTP query to ip-api.com in order to retrieve geolocation information of a given host or IP address
3 Feb 2013 by Matthew Faithfull
I know where you're coming from because I've faced the same issue with Boost library code myself. I want to use cool idea X but I don't want to be responsible for adding 2000 dependencies to the source tree and updating them every few weeks let alone fixing anything that breaks as a result of...
7 Feb 2013 by Matthew Faithfull
I wouldn't worry about TCP, that can take care of larger streams than 4GB. It does so every time I download a new Linux Distro these days, let alone when I'm playing with a few hundred hours of video footage.Asio is another question but I seriously doubt if you'll break it with anything like...
1 Jul 2013 by MaxLovic
HiGot Visual Studio 2013 preview. Finally managed to build my projects targeting XP. But can't build boost. Tried 'toolset=msvc-13.0', but didn't work.Is it possible to build boost 1.53.0 with msvc-13.0 or need to wait until the new release?Thanks.
9 Oct 2011 by mbue
Your source pointer type must depend on the target pointer type because the pRetargetingFunction depends on the target pointer type. An explicit cast is not useful for template...
22 Oct 2018 by MehreenTahir
This article will help you get started with socket programming in C++. We will build a TCP server and client using boost.asio library in C++.
16 Apr 2014 by Member 10271708
ini file may be not in usual, just like: [ip]ip1ip2ip3[domain]do1do2... in windows, there is 'GetPrivateProfileSection', But I want to do it by boost. I know there is a 'boost::property_tree::ini_parser', but read_ini() can not work for the ini format above.Is there...
12 Mar 2016 by Member 10305620
I am facing a strange issue while trying to resolve endpoints using boost resolver in c++.Case:I am trying to connect to a website http://localhostIpAddress/test/ using boost.where local address of server is "172.34.22.11"(say). I am facing the error saying "**resolve: No such host...