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 8553
0 votes

Are there any resources on how to identify problems that could best be solved with templates?

Just today, I used templates to implement a Finite State Machine to lex some input. … Generally speaking, templates make the most sense when implementing generic algorithms. If you're not implementing a generic algorithm, they don't make that much sense. …
DeadMG's user avatar
  • 36.9k
3 votes

C++ wrapper for "releasing" a singleton object

It's called a smart pointer. Specifically, the unique version is in the next Standard as a unique_ptr, and the reference-counted version is in Boost, TR1 and C++11 as shared_ptr. As for it's uses wit …
DeadMG's user avatar
  • 36.9k
1 vote

Template Functions and Function templates in C++

They are the same thing. The Standardese is "function template" and "class template", however many people (including myself) tend to refer to them as "template function" and "template class", for the …
DeadMG's user avatar
  • 36.9k
2 votes

Why C++ cannot adopt D's approach for its concept implementation?

Quite simply, C++ has a hell of a lot more historical baggage than D. It would be much easier to implement an awful lot of things if it wasn't for the fact that C++ has massive amounts of historical c …
DeadMG's user avatar
  • 36.9k
3 votes

Would "Efficient C++" book be irrelevant now due to compiler improvements?

More relevantly, there are simply new techniques and new language features- especially rvalue references, and compiler optimizations are much stronger than they used to be with features like cross-TU …
DeadMG's user avatar
  • 36.9k
1 vote

Is STL implemented with OO?

I learned that virtual member function which justifys the OO Where on earth did you hear that? The crucial tenets of object orientation is encapsulation and abstraction. virtual functions are ju …
DeadMG's user avatar
  • 36.9k
10 votes
Accepted

Implicit vs explicit interfaces

This means that any case which needs/benefits from value typing gains big benefits from templates. … Con: Templates are a bitch to compile and use, and they can be fiddly porting between compilers Con: Templates cannot be loaded at run-time (obviously), so they have limits in expressing dynamic data structures …
DeadMG's user avatar
  • 36.9k