09-11-2014, 03:19 AM
Would anyone object if I use explicit template instantiation?
Random Chitchat 2012-2016
|
09-11-2014, 03:19 AM
Would anyone object if I use explicit template instantiation?
09-11-2014, 03:30 AM
Flame war? Here's a suggestion for a suitable weapon:
09-11-2014, 04:23 AM
09-11-2014, 04:36 AM
simple example:
header file Code: template <class T> code file Code: template <class T> If Foo is only used for a few values of T then by explicitly instantiating the template we can move the template implementation to separate translation unit. I want to use this to allow testing code to replace types with Mocks without having to make everything inline. As to will it work on MSVC, that depends on how buggy it is . It was in c++98. If MSVC refuses to compile it then microsoft have a workaround that involves an anonymous namespace, a static function and some code.
09-11-2014, 06:53 AM
Looks okay to me, a bit on the weird side, templates in cpp files, but it makes some sense. Go ahead.
09-11-2014, 06:31 PM
So I had to use the first dynamic_cast<> in MCS
The cDropSpenserEntity class inherits from two bases and so it cannot be C-style-cast to the second base class. This had broken the redstone simulator on droppers, I wonder why no-one noticed earlier.
09-11-2014, 08:48 PM
This keeps reinforcing my point that we need unit tests, particularly for the redstone simulator. I should be ably to decouple it a little more easily with explicit instanciations.
I may be able to get rid of the dynamic_cast if I do that.
09-12-2014, 12:37 AM
C++14 has been ratified. So can we start using it in 2017/2018?
09-12-2014, 01:26 AM
Just got a very weird error message. It appears that if you have a template with a parameter of type char clang assumes that the parameter is a char so helpfully displays the ASCII character rather than the code. Which lead to an error message talking about a missing template specialisation for block type 'M'
09-13-2014, 09:05 PM
We have now reached 7000 commits!
|
« Next Oldest | Next Newest »
|