Questions tagged [c++03]
Code that is written to the 2003 version of the C++ standard. Use in conjunction with the 'c++' tag.
31
questions
3
votes
2
answers
86
views
Finding paths between triangles efficiently in 3D geometry #2
This post is an update of the one from here. I've updated the code and a couple pieces of the post itself.
I've been writing some functions used to find paths between two types of triangles - alphas ...
3
votes
3
answers
138
views
Finding paths between triangles efficiently in 3D geometry
An update to this post can be found here
I've been writing some functions used to find paths between two types of triangles - alphas and betas. Alphas are triangles that have been in a zone we ...
5
votes
1
answer
155
views
wrapper for common subset of auto_ptr and unique_ptr API
I read an interesting old question on the Software Engineering SE about how to transition away from std::auto_ptr. So I wrote a wrapper around the common subset of <...
1
vote
1
answer
555
views
Using mutable keyword to implement an owner-pointer class (C++03)
For a couple of days, I have been trying to implement an own templated class called owner_ptr (for my little project) whose instances has ownership over a ...
5
votes
3
answers
489
views
Inheriting from std::auto_ptr to support deletion of allocated arrays in C++98/C++03
[EDIT: Thanks for your opinions. I think this topic is discussed enough. Since std::auto_ptr is removed from C++17, I decided to drop the idea of inheriting from <...
3
votes
1
answer
5k
views
Functions asking for user input, with default prompts
I succeeded in the first part of the exercise, this attempt is the second part. I am not sure I have accomplished the goal, and would appreciate the input of more knowledgeable minds. As always, ...
1
vote
0
answers
1k
views
UVa 524 - Prime Ring
The challenge
A ring is composed of n (even number) circles as shown in diagram. Put natural numbers 1,2,...,n into each circle separately, and the sum of numbers in two adjacent circles should be ...
8
votes
3
answers
936
views
UVA 750: 8 Queens Chess
In chess it is possible to place eight queens on the board so that no
one queen can be taken by any other. Write a program that will
determine all such possible arrangements for eight queens given ...
3
votes
2
answers
1k
views
OrderedList class template
I called my template OrderedList, but I don't like the name. Is there a better one?
It stores a vector of values of type T, and ...
2
votes
2
answers
2k
views
Simple class to mimic a dynamic array
for my c++ class I was asked to write a class with the following characteristics:
Implement a vector replacement that operates only on integers (you don't need to use templates like the normal STL)...
3
votes
1
answer
575
views
Memoization via template
This is kind of follow up of this question on stack overflow...
I wrote the following to utilize memoization for functions that take a single parameter and return a value:
...
2
votes
2
answers
1k
views
Relaying stdin data from one thread to another
I'd like to know if this piece of code is thread-safe. I'm learning something about threads, queues and synchronization, and I'd like to make sure this is correct, before moving forward to next step.
...
5
votes
1
answer
14k
views
Converting a string to a list of key-value pairs
I'm trying to convert a string (here after called input) into a vector of key-value pairs, all in C++03 (cannot use C++11, cannot use Boost libs).
The string in ...
4
votes
2
answers
3k
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 ...
4
votes
1
answer
148
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 ...