
28 Feb
2013
28 Feb
'13
1:55 a.m.
AMDG On 02/27/2013 05:32 PM, Chris Stankevitz wrote:
On Wed, Feb 27, 2013 at 4:49 PM, Chris Stankevitz
wrote: Attached is an example of how do do this. Drawback: the TCPositionTraits object now has a lot of typing in it. And if/when you create another object (e.g. TCEmployeeTraits) you are going to have to do a lot of typing again. There will be a lot of code duplication.
Attached is a version that eliminates the code duplication. Drawback: it's now a mess of templates and specializations.
One more thing that would make this look a bit better: ... mItems = { makeItem(&TCPosition::mLatitude, TCPosition::sLatitudeTraits), ... }; makeItem is a pretty simple function template. In Christ, Steven Watanabe