C++03 is an earlier revision of the C++ standard, with C++98 as its predecessor and C++11 as its successor.

learn more… | top users | synonyms

4
votes
2answers
150 views

Portable C++98 thread class akin to std::thread

I want a homegrown version of C++11's std::thread. My motivation is to avoid manual memory management of the arguments passed to the thread function. I'm restricted ...
1
vote
0answers
24 views

IUnitTest, INonCopyable, and IMapKey mixins

I am creating a boiler-plate namespace that will allow me to ensure proper coding practices are followed and avoid gotchas. Looking over my code below; can you see any "no-no's" or gotchas? Can you ...
4
votes
1answer
63 views

Distance between angles as points

This code calculates the distance between angles, particularly for n-tuples of angles. One example where this situation occurs is as follows: I'm using a 2 arms, one 6 degree of freedom and the other ...
1
vote
0answers
23 views

Time calculation to identify current phase

I have a program that works by periodic phases, and I need to understand, depending on the current time, which phase should be executed. The following is not for busy wait, it's just a check. I'm ...
2
votes
1answer
31 views

Implement test which tries function with diferent params and expected results

What could I improve in the following code? The goal is to test a function againts a table of input parameters and compare to some expected results with some tolerance (as there are random variables ...
1
vote
1answer
98 views

Circular buffer offsets and sorted set of offsets sorted on their index

Consider the following C++03 code: ...
0
votes
1answer
71 views

Converting integers to strings

I drafted a method that I intend to use to convert integers to strings. Is there a way to make it faster? Are there any "simple" changes I could make to improve its performance? This cannot be done ...
7
votes
1answer
130 views

Member function state machine

For various reasons, I wrote this. For one, I don't like to wrap every single function in a separate class, which is too verbose. It's a state machine based on GoTW 57 function pointer wrapping and ...
2
votes
0answers
72 views

Length Conversions

I'm trying to create some helper functions that will allow me to convert from one unit of measurement to another. I eventually will need to be able to do speeds and temperatures as well, but so far, ...
4
votes
3answers
119 views

Using a template to cycle through a sequence of containers

I'm trying to implement a template that takes a container as parameter. The template has a getnext method that cycles through the elements in the parameter. Take ...
5
votes
2answers
734 views

Fixed size matrix implementation

I implemented a fixed-size matrix class which supports basic matrix operations (cannot use C++11). What do you think, and how could it be improved? ...
5
votes
2answers
85 views

Avoiding casts in abstract types

I asked this question on Stack Overflow and in the comments someone had this to say. In a proper design, you should almost never have to do a dynamic_cast, even if it's hidden inside some nice ...
4
votes
1answer
425 views

Dijkstra's and Prim's algorithms: correctness/efficiency

This is in preparation for a competition that only allows C++03. ...
1
vote
1answer
273 views

RAII-Style Lockable Objects

TL;DR: Without the phrases "use Boost" and "use C++11", does the posted code for RAII-style locking of a resource look correct and safe, or is there something I've missed. Long Version: I am working ...
2
votes
1answer
393 views

Using set for unordered, unique list of elements

In C++11 we have the option of using std::unordered_set if we require a list of elements that have no duplicates but order is not important. In C++03 we don't have ...
10
votes
2answers
588 views

make_auto implementation for C++03 compilers

I want to provide, in the the spirit of C++11/boost make_shared and C++14 make_unique, a production-ready make_auto for C++03 compilers. So, inspired boost's make_shared implementation for C++03 ...
3
votes
2answers
220 views

legacy code and exception handling

After some 'digging' into the dark corners of legacy code I've found class, which handles INI files. It does reading and writing to the file, but I haven't found any exception handling logic. What ...
8
votes
2answers
511 views

Custom nullptr_t class

I tried to write a nullptr_t class based on the official proposal to be used in C++03 only. The only differences with the proposal are that we can compare two ...