Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Do C++ Programmers Overuse Templates?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Jerry Coffin, post: 3700908"] This really is a problem with templates as currently defined -- but C++ 0x adds Concepts, which deal with this problem (among several others) quite nicely. The problem is that you don't have any way of directly specifying the requirements of a set of types used to instantiate a template. All the compiler can do is try to instantiate it over the specified types, and report any errors that arise in the result -- but even though the error is usually in the instantiating code, the error will usually be reported as a problem with the type over which it's instantiated (e.g. that it can't find a ctor to allow an assignment to take place). Concepts allow you to specify requirements on the type(s) over which a template can be instantiated -- and the compiler can directly report problems if you try to instantiate over types that don't support what's specified. This isn't really a problem with templates, but with a particular tool. There are debuggers that work quite nicely on templated code. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Do C++ Programmers Overuse Templates?
Top