C++11 is the successor to the C++03 standard, adding various core language changes and fixes, and an improved and expanded standard library.

learn more… | top users | synonyms (1)

-1
votes
0answers
10 views

Tic-Tac-Toe in C++11 - follow-up 3

Previous question: Tic-Tac-Toe in C++11 - follow-up 2 Is there any way to improve this code? ...
1
vote
2answers
76 views

Tic-Tac-Toe in C++11 - follow-up 2

Previous question: Tic-Tac-Toe in C++11 - follow-up Is there any way to improve this code? ...
2
votes
2answers
64 views

C++ Prime Factorization

I just picked up C++ today and I wonder if this is c++-like. I have a bit of experience with Java. This is a program that takes a number as input and outputs its prime factorization in no particular ...
7
votes
1answer
54 views

Snippets Manager

This basically manages a set of snippets, saving and loading it. snippets.cpp ...
2
votes
2answers
80 views

Binary Search Tree in C++

I'm writing C++ for the first time and wanted to implement a BST. I come from writing C, so I tend to write code in that way. I'm trying to wrap my head around smart pointers, but can't seem to get ...
3
votes
3answers
98 views

AVL tree for inserting and searching

I have made an AVL tree. It works and does what it needs to do. I only need it to insert and search. I am comparing how long it takes to load and search a dictionary file in relation to other various ...
5
votes
3answers
97 views

Append a string to each line in a file

I wrote (several months ago) a program that will take an input file, with a provided std::string, and append that to each individual line in the file. Looking at ...
3
votes
1answer
34 views

Prim algorithm implementation for adjacency list represented graph

Please review the implementation of Prim algorithm. Points on which I have doubt: My Graph doesn't have any ID for nodes. Nodes are accessed based on their data. ...
1
vote
0answers
21 views

Kruskal algorithm implementation for adjacency list represented graph

Please review the implementation of Kruskal algorithm. Points on which I have doubt: My Graph doesn't have any ID for nodes. Nodes are accessed based on their ...
3
votes
0answers
33 views

Djkistra shortest path implementation for adjacency list represented graph

Please review the implementation of Djkistra algorithms. Points on which I have doubt: My Graph doesn't have any ID for nodes. Nodes are accessed based on their ...
4
votes
5answers
291 views

Creating vector of primes using Sieve of Eratosthenes

Please review my Sieve of Eratosthenes implementation. ...
4
votes
4answers
142 views

Tic-Tac-Toe in C++11 - follow-up

This is based on my first Tic-Tac-Toe game: Tic-Tac-Toe game in C++111 i have come up with different game logic for my game. I would like to know which one is more reliable and effective and how to ...
5
votes
3answers
151 views

Small command-line helper tool

I've coded a small command line helper tool for this library I'm working on. The library provides tools for the use of Virtual Texturing on iOS devices (mainly games). This little command line helper ...
6
votes
5answers
413 views

Tic-Tac-Toe in C++11

I have found Tic-Tac-Toe source code: Tic Tac Toe in C++ I have rewritten the source code in C++11 as shown below. How can I minimize hardcoding in the game logic? ...
2
votes
2answers
81 views

Superior improved stack implementation using a linked list

Please review my hopefully improved stack implementation As suggested by some answers to my previous code, some of the functions can be overloaded to provide versions of return by value, return by ...
1
vote
1answer
33 views

Homogenising iterator and const_iterator

I've reworked (for C++11) a section of PyCXX which contained an almost identical iterator and const_iterator. I would like to ...
0
votes
0answers
27 views

Using lambda functions to structure code in C++11, good or bad? [closed]

Something that I've done recently after becoming more familiar with C++11's lambda functions is that I've started embedding comments into the names of lambda functions. For example, previously I'd ...
5
votes
1answer
78 views

Simple simulated annealing template in C++11

This simulated annealing program tries to look for the status that minimizes the energy value calculated by the energy function. The status class, energy function and next function may be ...
8
votes
1answer
65 views

consecutive_find function for returning a consecutive range of elements

consecutive_find() is a function that returns the beginning of a range that contains strictly N consecutive elements. It was part of a SO question that I answered. ...
1
vote
0answers
44 views

Reader/writer spinlock

I wrote some code for a reader/writer spinlock that gives some preference to writers. Is the code correct? The code uses readerCount for the actual locking and just ...
2
votes
1answer
43 views

Static to Instance method trampolining with templates

I finally have a working trampoline mechanism. Would anyone care to critique it? Ideone ...
2
votes
3answers
378 views

Improved stack implementation using a linked list

Since my original Stack implementation has lots of bugs that I did not notice, I thought I would recreate and try to improve it. Please review this version. Note ...
3
votes
1answer
57 views

File Output given repeated small operations

I want to write a file which contains values for each cell of a CFD computation. This will be an input file to the program which runs the computation. Currently, the most dubious section of my code ...
1
vote
2answers
49 views

Binary search tree with templates

I am currently attempting to become proficient in C++ and started by implementing a basic binary search tree. Most of the programming I have done is in Ada, Python and C. I would like to be able to ...
1
vote
2answers
113 views

std::vector of pointers with the rule of three

I have a class that has a std::vector of pointers, I'm NOT going to give any of those pointers to objects outside of it, I mean, I'm not going to share the ...
5
votes
3answers
258 views

Simple stack implementation using linked list

Please review my Stack using linked list: ...
5
votes
2answers
170 views

Constructing a graph and performing a depth-first traversal

Please review the use of pointers and design in graph construction code and its depth first traversal. I haven't used smart pointers as I want to understand any issues in following implementation with ...
5
votes
2answers
176 views

Extremely simple stack implementation using a vector

Please review my simple Stack: ...
5
votes
2answers
66 views

Using a CRTP approach for loading OpenGL programs

I wanted to try using CRTP (also new for me) to try making the loading of shared resources implicit. (Specifically I'm using it for loading OpenGl shader programs) This will also help separate some ...
3
votes
1answer
59 views

Implementing binary output to a file in C++11

I would like to have a class which supports outputting bits into a file. This is what I came up with but I fear there are many poor decisions. Should I inherit from a ...
11
votes
6answers
861 views

What's in your file?

Another more simple project from my CS1 class that I didn't upload while I was sick last week: Write a program that computes all of the following statistics for a file and outputs the statistics ...
8
votes
3answers
338 views

Deviating from the norm

Back on track with my C++ saga: The standard deviation of a list of numbers is a measure of how much the numbers deviate from the average. If the standard deviation is small, the numbers are ...
3
votes
0answers
45 views

Elementwise iterator adaptor

There are many C++ implementations of the Euclidean vector. I.e., a vector in what is typically a 3- or 4-dimensional space. Something along the lines of ...
3
votes
3answers
290 views

DateTime-like class implementation in modern C++

In modern C++, there is no class like datetime in the standard which can be used in the program. However, with additional of modules like ...
3
votes
1answer
71 views

Finding a word ladder using Breadth First Search

This is a LeetCode problem called Word Ladder: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, where only one letter can ...
5
votes
1answer
135 views

Dereference template class

Usually, C++ standard library algorithms have two versions, e.g.: ...
8
votes
4answers
440 views

Computing factorials

I am computing factorials as part of teaching myself C++. I am looking for feedback on efficiency, style and any bad practices I may be using. ...
3
votes
2answers
98 views

Implementation similar to boost::optional for modelling function failure

The idea being you can have a simple type called maybe that wraps another type, which provides the ability to possibly not return a value from a function. I'm sure ...
7
votes
1answer
69 views

Elementwise perfect forwarding of a member range

Perfect forwarding is usually done with std::forward. E.g., ...
16
votes
1answer
262 views

Ultimate Tic-Tac-Toe with AI and GUI

During my hiatus, I decided to revisit some of the Tic-Tac-Toe questions here. I created a simple Tic-Tac-Toe GUI game, and then thought, might as well do the Ultimate Tic-Tac-Toe challenge. I am ...
7
votes
1answer
55 views

Get extension(s) from path

I'm writing an utility function that returns the extension(s) of a boost::filesystem::path (v3). Boost's path class already has some of this functionality ...
4
votes
2answers
46 views

Threaded generalised transform

I'm writing an application which works with huge amounts of sequential data, and often found the need to use std::transform. I see two potential improvements to ...
7
votes
2answers
100 views

Sockets and networking for a multi-platform game

I'm in the process of adding network support for a little Mac & Windows game I'm writing. Today I've finished the basic sockets plus a few other network helpers and would appreciate having the ...
1
vote
0answers
45 views

Enum list to STL container, part 2

Original question: Enum list to STL container Goal: Write a function enumToSTLContainer() that is to return any STL container whose elements are from a specified ...
4
votes
1answer
86 views

Adjacency-list graph implementation in C++ (redone from scratch)

I had posted here before, but I decided that the approach used earlier - where every Vertex stores a vector of pointers to ...
3
votes
1answer
103 views

Public interface for nearest neighbor data structures

I am making a small library of metric data structures. That is data structures, which associate points in the n-dimensional space with objects and allow the user to find objects which are closest to a ...
12
votes
3answers
172 views

Refactoring image loading/manipulation class

I have this Image class that I've been using for some time now on personal projects and games I eventually write. It was written in C++98 style and it is starting ...
7
votes
0answers
45 views

Wrapping types with alignment requirements

Visual Studio 2013 still doesn't support the alignas keyword in C++11. This causes some problems with alignment of types in various situations. Thankfully the ...
2
votes
0answers
64 views

GOF Composite Design Pattern Implementation Using Modern C++

After reading about the composite pattern from the GOF design pattern book, I thought to re-implement the code mentioned in the motivation section using the modern C++ concept/idioms. Below is the ...
6
votes
4answers
795 views

String case reverse function in C++

This reverses the case of a character in a string (a string being an array of characters). How does it look? Anything I can improve on? Let's get critical here. ...