Relative Content

Tag Archive for c++boost

Debugging SIGFPE exception

I am working on a large project and we are moving to gcc12 and upgrading the boost version. In one of the testcases, we are seeing SIGFPE (Linux) thrown in the following boost code.

gzip_compressor in boost does not seem to save and load compressed streams properly

namespace io = boost::iostreams; void saveCompressedData(const std::string& file_path, const std::vector<double>& bid, const std::vector<double>& ask, const std::vector<double>& close_prices, const std::vector<int>& tick_numbers) { try { // Create an output file stream and filtering stream std::ofstream file(file_path, std::ios_base::out | std::ios_base::binary); if (!file) { std::cerr << “Error opening compressed file for writing: ” << file_path << std::endl; return; } […]

gzip_compressor in boost does not seem to save and load compressed streams properly

namespace io = boost::iostreams; void saveCompressedData(const std::string& file_path, const std::vector<double>& bid, const std::vector<double>& ask, const std::vector<double>& close_prices, const std::vector<int>& tick_numbers) { try { // Create an output file stream and filtering stream std::ofstream file(file_path, std::ios_base::out | std::ios_base::binary); if (!file) { std::cerr << “Error opening compressed file for writing: ” << file_path << std::endl; return; } […]

unget or similar solution for boost::asio::ip::tcp::iostream

I want to read binary messages from a boost::asio::ip::tcp::iostream and I have therefore overloaded the >> operator with istream &operator>>(istream &stream, Message &message) so I can read messages with stream >> message which works fine.