13,744 reputation
12049
bio website
location
age
visits member for 3 years, 6 months
seen Apr 15 at 4:55

Jan
4
comment Can only integers be stored as register variables?
@Yousaf: That it depends on the platform, compiler, compiler options and exact piece of code. It's best left up to the compiler to decide.
Jan
3
comment Using std::sort et al. with user-defined comparison routine
Nor can I imagine an implementation of sort that would run out of bounds on invalid comparison function. Normal implementation of either quick sort, merge sort nor heap sort can't do that.
Jan
3
comment Using std::sort et al. with user-defined comparison routine
What implementation of std::sort is that? I've had my share of bugs in comparison operators, but the only think I've ever got from std::sort was an assertion, never segfault and never endless loop. True, you don't want assertion either.
Jan
3
revised Can only integers be stored as register variables?
added 80 characters in body
Jan
3
comment Can only integers be stored as register variables?
@delnan: The fact that they use heuristic algorithm does not change the nature of the problem itself and the heuristic is still based on the mathematical apparatus around graph colouring. Since the problem is NP-complete, I don't think any compiler searches exact solution; it would be too expensive.
Jan
3
answered Can only integers be stored as register variables?
Jan
3
revised What does the Apache licensing mean by “Permitted: Commercial Use”
added 4 characters in body
Jan
3
awarded  Nice Answer
Jan
3
revised What does the Apache licensing mean by “Permitted: Commercial Use”
added 574 characters in body
Jan
3
answered What does the Apache licensing mean by “Permitted: Commercial Use”
Jan
1
comment Emotional detachment from bad code
@gnat: It kind of does. Whether code is ugly is subjective.
Dec
28
comment Why are reference-counting smart pointers so popular?
@supercat: Yes, you can get a special type of pointers to work. It's basically what Microsoft did in Managed C++. And note, that they would not have to keep a list of anything at runtime; compile-time support is sufficient. But it would not be very useful with all the existing code using plain old pointers.
Dec
28
comment Why are reference-counting smart pointers so popular?
@supercat: Maintaining a list at runtime would be more expensive than reference counting, therefore it would not have any advantage over shared_ptr. Most probably it would be a lot more expensive.
Dec
28
comment Why are reference-counting smart pointers so popular?
@supercat: Standard pointers can be reinterpret-casted, which prevents the collector from ever being sure what is a pointer. You'd need special kind of pointers and special rules for them and than it would no longer be useful with existing code.
Dec
23
awarded  Nice Answer
Dec
20
revised How to mock method with hard coded object?
be more explicit that changing the object creation is wrong
Dec
20
comment How to mock method with hard coded object?
@DeveloperArnab: If you inject different Employee object in tests, you won't test the code that normally creates it. So you shouldn't change it.
Dec
20
comment How to mock method with hard coded object?
@DeveloperArnab: The objects will be different, but they will have known content. So all you need to do is make the mock do custom comparison instead of object identity.
Dec
17
answered How to mock method with hard coded object?
Dec
12
revised How is a committer expected to behave?
added 68 characters in body