Skip to main content

Questions tagged [boost]

Boost is a large collection of high-quality libraries intended for use in C++. Boost is free, and is often considered a "second standard library".

Filter by
Sorted by
Tagged with
5 votes
1 answer
289 views

A Summation Function For Boost.MultiArray in C++

This is a follow-up question for A Summation Function For Arbitrary Nested Vector Implementation In C++ and A Summation Function For Various Type Arbitrary Nested Iterable Implementation in C++. I am ...
JimmyHu's user avatar
  • 5,214
3 votes
1 answer
142 views

An element_wise_add Function For Boost.MultiArray in C++

This is a follow-up question for A Summation Function For Boost.MultiArray in C++. Besides the summation operation of all elements, I am trying to focus on the element-wise operation here. The main ...
JimmyHu's user avatar
  • 5,214
27 votes
1 answer
20k views

Efficient smart pointer implementation in C++

The idea behind this is mainly educational but I might even consider using it in reality if turns out to be good. Here's my first try at implementing smart pointers: ...
mmirzadeh's user avatar
  • 411
13 votes
4 answers
3k views

FizzBuzz, ’17-style

My exercise is to write the Fizz Buzz problem with the following in mind: Use the latest up-to-date style and best practices for a C++17 compiler. Don’t just show that I can write a loop. Rather, ...
JDługosz's user avatar
  • 11.4k
6 votes
1 answer
156 views

program options from command line initialize [v2 - after CR]

After getting a CR from @pacmaninbw and @ALX23z here, I want to share my new code, and to ask for better ways (which always exist) to improve the code, even with new libraries. The only thing that ...
Coral Kashri's user avatar
6 votes
1 answer
184 views

A Various Container Type Arbitrary Nested Iterable Generator Function Implementation in C++

This is a follow-up question for std::array and std::vector Type Arbitrary Nested Iterable Generator Functions Implementation in C++ and std::deque and std::list Type Arbitrary Nested Iterable ...
JimmyHu's user avatar
  • 5,214
6 votes
1 answer
152 views

Non-nested std::deque and std::list Generator Function for arithmetic_mean Function Testing in C++

This is a follow-up question for A non-nested test_vectors_generator Function for arithmetic_mean Function Testing in C++ and An arithmetic_mean Function For Various Type Arbitrary Nested Iterable ...
JimmyHu's user avatar
  • 5,214
5 votes
2 answers
473 views

A Matrix Library in C++;

I have written a Matrix library that contains all the main properties of matrices. It's a relatively long project, I am hoping it is ok to post here since I really want to have it reviewed. The ...
HBatalha's user avatar
  • 355
4 votes
1 answer
146 views

An Add/Minus Operator For Boost.MultiArray in C++

This is a follow-up question for An element_wise_add Function For Boost.MultiArray in C++. The following code is the improved version based on G. Sliepen's answer. On the other hand, the built-in ...
JimmyHu's user avatar
  • 5,214
3 votes
1 answer
110 views

A recursive_transform Template Function for BoostMultiArray

This is a follow-up question for A Sine Template Function For Boost.MultiArray in C++, A recursive_transform for std::array with various return type, A recursive_transform for std::vector with various ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
58 views

A non-nested test_vectors_generator Function for arithmetic_mean Function Testing in C++

This is a follow-up question for An arithmetic_mean Function For Various Type Arbitrary Nested Iterable Implementation in C++. As Toby Speight's answer mentioned, some self-checking unit tests are ...
JimmyHu's user avatar
  • 5,214
0 votes
1 answer
511 views

What can I do better in my C++ serialization implementation?

I want to serialize a class Mango recursively. ...
James_sheford's user avatar
10 votes
1 answer
1k views

String-formatting and printing functions

As a small exercise I have written some string formatting and printing functions in C++11. I would like a bit of code review, not so much on the merits of using this over something like ...
Chris_F's user avatar
  • 347
10 votes
1 answer
245 views

Random Number Generator with Loads of Useless(-ish) Features

For fun, and to refresh my memory on Boost's program_options library, I have written a program with the goal of randomly generating numbers with loads of useless(-ish) features. I have termed it ...
esote's user avatar
  • 3,770
10 votes
2 answers
2k views

boost::unordered_set intersection using templates

I wrote this function to do unordered_set intersection using templates. I have seen this answer but I thought that it was overkill. I would like the method to take ...
pbible's user avatar
  • 419
9 votes
1 answer
1k views

Simple parsing for string formatting (version 2)

This is my second attempt (version 1) at writing a string formatting utility which uses parsing. This time I more explicitly designed it as a finite state machine. I have very little experience with ...
Chris_F's user avatar
  • 347
5 votes
1 answer
2k views

Simple parsing for string formatting

Recently I submitted some string formatting and printing code (found here) that I wrote as an small exercise. It was implemented naively using string replacement. This time around I wanted to actually ...
Chris_F's user avatar
  • 347
4 votes
1 answer
276 views

Template with boost::operators extremely verbose and repeating

I got the following ugly code: ...
hivert's user avatar
  • 291
4 votes
1 answer
267 views

Brute-force search for solution to an unsolved mathematical inequality

From this Wikipedia article, the following unsolved problem is presented as a result of Waring's problem: It has been proven that a finite number of k exist, and so far none are known. The follow ...
esote's user avatar
  • 3,770
3 votes
1 answer
126 views

A filled_multi_array Template Function for Boost.MultiArray in C++

This is a follow-up question for A ones Function for Boost.MultiArray in C++. Thanks to G. Sliepen's answer, the mentioned method which can set various initial value is better in generic purpose usage....
JimmyHu's user avatar
  • 5,214
3 votes
2 answers
885 views

program options from command line initialize

I'd like to receive a CR for the following command-line program options' initializing using boost::program_options. I'd like to know if there is a better way of ...
Coral Kashri's user avatar
2 votes
1 answer
134 views

A ones Function for Boost.MultiArray in C++

This is a follow-up question for An Element-wise Increment and Decrement Operator For Boost.MultiArray in C++ and A recursive_transform Template Function for BoostMultiArray. I am trying to implement ...
JimmyHu's user avatar
  • 5,214
2 votes
1 answer
78 views

A Sine Template Function For Boost.MultiArray in C++

This is a follow-up question for An element_wise_add Function For Boost.MultiArray in C++. Besides the basic add operation applying onto each element, I am trying to implement a sine template function ...
JimmyHu's user avatar
  • 5,214
2 votes
2 answers
213 views

Random Number Generator Followup: Choosing the Generator Algorithm and the Distribution

This question is a follow-up from my previous code review question. This question regards the ability to choose a predefined random number generator algorithm and also choose a generator distribution. ...
esote's user avatar
  • 3,770
2 votes
0 answers
56 views

program options from command line initialize [v3 - after CR]

After my previous code review, I'm sharing my new code, and asking for better ways (which always exist) to improve the code, even with new libraries. The only thing that important to me, is the way of ...
Coral Kashri's user avatar
1 vote
1 answer
86 views

An Element-wise Increment and Decrement Operator For Boost.MultiArray in C++

This is a follow-up question for A recursive_transform Template Function for BoostMultiArray and An Add/Minus Operator For Boost.MultiArray in C++. Besides the add / minus operator for Boost....
JimmyHu's user avatar
  • 5,214
1 vote
1 answer
129 views

A get_extents helper function for Boost.MultiArray in C++

This is a follow-up question for A filled_multi_array Template Function for Boost.MultiArray in C++. Based on G. Sliepen's answer, there is another get_extents ...
JimmyHu's user avatar
  • 5,214
-2 votes
1 answer
523 views

How can I optimize C++ serialization? [closed]

I want to serialize a C++ class Ramdomclass . Below is the serialization function. ...
Sebastian Orteho's user avatar