1,068 reputation
1710
bio website
location Umeå, Sweden
age 29
visits member for 2 years, 4 months
seen 2 days ago

C++ developer at heart, loves to play around with graphics APIs.


2d
comment Does it make sense to choose UTF-32, based on concern that some basic rule will be broken for UTF-8?
wstring is a basic_string<wchar_t>. wchar_t is implementation-defined in size and definitely not enough bits for UTF-32 on Windows.
Apr
14
comment Why Num&sizeMinusOne faster than num&(size-1)
Note that the question as it stands now is about implementing power-of-two modulo by either and masking or the generic % modulo operator. You seem to have at this time described the difference between two and calls.
Mar
20
comment Why isn't the arrow operator in C++ just an alias of *.?
@Guss: I cannot find any chapter and verse for your claim, nor reproduce it in a compiler. C++11 13.5.6/1 indicates that if a suitable overload exists, x->m shall be interpreted as (x.operator->())->m. If the LHS is something that has a suitable overload of operator-> again, this process recurs until there's just the usual (*x).m effect of 5.2.5/2.
Mar
10
comment Using scoped enums for bit flags in C++
The unscoped enumerator is only declared in the surrounding scope. Being able to qualify it by the enum-name is part of lookup rules, not the declaration. C++11 7.2/10: Each enum-name and each unscoped enumerator is declared in the scope that immediately contains the enum-specifier. Each scoped enumerator is declared in the scope of the enumeration. These names obey the scope rules defined for all names in (3.3) and (3.4).
Feb
5
comment Best way to hide API key in source code
It may be beneficial to outline the concept of of an API key for readers unfamiliar with it. An API key is a secret awarded to the developer of some software interacting with a service (typically a web service). It is used to identify the source of traffic, lift restrictions vs. anonymous accesses, and to bill the owner of the key for service usage. You are expected to keep it moderately hidden and preferably revoke it if it's compromised. As it needs to be communicated in full to the service, you always lose.
Jan
7
comment argument grouping with parenthesis are valid in C++?
On some (conformant, not VS2013) C++11 compilers, the function call can be made as func({1, 2, 3, 4}, 5.5f);. Note that the using namespace std; statement is not necessary for the solution, just a habit of the answerer.
Dec
18
comment Where does the tradition of shell prompts in code snippets come from?
In instructions that occasionally require root, it's common to see $ and # used to indicate which operations require escalation.
Dec
17
comment Should Repositories return IQueryable?
This answer does not stand on its own without consulting the volatile external link. Consider summarizing at least the key points made by the external resource, and try to keep personal opinion out of your answer ("worst idea I've heard"). Also consider removing the code snippet that seems unrelated to anything IQueryable.
Jul
20
comment Is there a name for this tree variant?
The intent was never to recommend another structure. It was evidence to an existing name for a similar concept.
May
2
comment Solution with multiple projects and (GitHub) single issue tracker and repository
An answer should answer the real underlying question and demonstrate some actual experience or common practices. A simple "yup/nope" with some non-applicable rationale isn't a quality answer. I'm sorry, but your answer contributes nothing to the actual underlying question.
May
2
comment Solution with multiple projects and (GitHub) single issue tracker and repository
What does the organization of an IDE/build have to do with the number of repositories and issue trackers you have? You can still fit into the IDE model with multiple repositories as submodules, for example.
Dec
30
comment Having error codes option in C++ library for performance
Whatever you do, please use a less generic name for your macro. At least slip in the name of the library somewhere to help prevent collisions.
Dec
18
comment Using a GPL game engine
@JanHudec: My comment is in a context that has since then been removed, either due to editing of the original question or removal of another comment I was referencing. Please refrain from jumping to conclusions.
Dec
10
comment Inheritance from the objects themselves
If you have template <int N> struct Foo {}; you could do struct Buz : Foo<2> {};. The different instantiations of Foo would be unrelated to each other, but you could always give them a common base. Note that N is a compile-time constant here, so you can use it for things like array sizes and template metaprogramming.
Dec
3
comment Strategy for avoiding duplicate object ids for data shared across devices using iCloud
How about UUIDs?
Nov
26
comment What reasons are there to reduce the max-age of a logo to just 8 days?
I don't see why this cannot be seen as a piece of courtesy information. Your bullet point seems to be overly generalizing and ruling out this possibility.
Nov
12
comment Should I expect my team to have more than a basic proficiency with our source control system?
Did anyone bother to figure out the workflows you had and map them to the primitives that the new VCS has to offer? It's quite easy to shoot yourself in the foot with commands that sound like the ones you're used to, and you really need someone to orchestrate something like this. Where's the bloke responsible for this change?
Nov
12
comment Should I expect my team to have more than a basic proficiency with our source control system?
I hope you have good repository backups.
Nov
11
comment How can I get my own encryption algorithm tested?
There's lots of people who are willing to put effort into cracking his algorithm - it's the shady ones with black hats.
Oct
19
comment Is it okay to define a [] method in ruby's NilClass?
This smells like Perl autovivification. There's many fine caveats there, and you should probably find out which before changing a global behaviour of your language just in order to be lazy.