Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 15094

Code that is written to the 2011 version of the C++ standard, sometimes known by its pre-publication name of "C++0x". Use in conjunction with the 'c++' tag.

10 votes

Making C++11 range-based for loops a bit more useful

You can use braces to return from your functions. That way, you won't have to repeat long and cumbersome types (DRY, as much as possible). For example, ConditionalRange::end: iterator_type end() cons …
Morwenn's user avatar
  • 20k
8 votes
Accepted

static_new and static_delete

I still have trouble understanding how the whole works, but there are still some small things that could be improved: In your comments, you say that A is an integer type used as a bitmask. The safes …
Morwenn's user avatar
  • 20k
4 votes

Lexer code in C++

Some things you can improve: The initialization of reserved_words is far too complex. You can use an initializer it to simplify it: static const std::unordered_map<std::wstring, LexedFile::Token> r …
Morwenn's user avatar
  • 20k
5 votes
Accepted

AnySetValue - a set of with multiple types of values

I don't see any real problem, only tidbits and things that could potentially be done differently: Your header guard name is actually reserved to the implementation since it uses a double underscore. …
Morwenn's user avatar
  • 20k
22 votes

Simple integer range for C++11 range-based for loops

You can make the class template with trivial changes (add template<typename T> and change int by T in your classes), then make a construction function that deduces integer types: template<typename T> …
Morwenn's user avatar
  • 20k
11 votes
Accepted

Improved indices trick

You can get rid of the <type_traits> header by replacing your std::enable_if by a bool template specialization: template <::std::size_t, ::std::size_t, bool> struct expand_indices_impl; template <:: …
Morwenn's user avatar
  • 20k
12 votes

One-to-many multiplicity pattern

There are way too many const in your code. const-correctness is great, but you are overdoing it. A few tips to improve your code: When I run g++ with the option -Wextra, I get a warning with this pi …
Morwenn's user avatar
  • 20k
9 votes

Toy virtual machine

A few notes to complete what @vnp already said: When you open several namespaces at once and close them at once, you better indent only once since the double indentation won't add to clarity but wil …
Morwenn's user avatar
  • 20k
3 votes

Mapping a textual method name to a function

std::call_once is an interesting tool, but there are alternatives built into the language: namely, you can use the Immediately-Invoked Function Expression (IIFE) borrowed straight from JavaScript and …
Morwenn's user avatar
  • 20k
8 votes

Checking for a palindrome

First of all, you should pass the std::string by const reference and not by value, therefore, replace std::string s by const std::string& s, otherwise you will make a whole copy of the string everytim …
Morwenn's user avatar
  • 20k
5 votes
Accepted

Template data types implementation

Here are some small things you could di in order to improve your design: First of all, you have a typo: you wrote Map::Iiterator begin(); instead of Map::Iterator begin();. You use KeyType and DataT …
Morwenn's user avatar
  • 20k
4 votes
Accepted

Concept based polymorphism

There is not much to be said actually, the concept-based polymorphism seems to be well implemented. You can slightly improve your push_back method by having it emplace_back the std::unique_ptr. It wil …
Morwenn's user avatar
  • 20k
4 votes
Accepted

Resource manager implementation, with resources being organized in a scope-like hierarchy

I can't answer all your questions, but here are some things you can improve or some guidelines you can follow: Always pass std::shared_ptr by const reference. There are several reasons for this, som …
Morwenn's user avatar
  • 20k
5 votes

Is this a conforming implementation of duration_cast?

I can't say for sure about the internal logic but I can point some problems or things that could be improved in your piece of code: First of all, typename is missing before the names, making your co …
Morwenn's user avatar
  • 20k
5 votes
Accepted

Model of Arithmetic concept for usage as Opaque typedef

Here are some small things you can improve: constexpr inline isn't necessary: constexpr already implies inline. In the following function: constexpr friend inline Arithmetic operator+(Arithmetic a, …
Morwenn's user avatar
  • 20k

1
2 3 4 5
7
15 30 50 per page