
On Tue, May 18, 2010 at 11:02:56PM -0700, Eric Niebler wrote:
I recently solved a devilish C++ coding problem related to the new sub-domain feature of Proto. I don't care for my solution, so I thought I'd throw it out there and see if some smart person could do better. I'm sending along the skeleton of the solution and some tests that it needs to satisfy. The rest is up to you.
[...]
Your job: implement the deduce_domain3 template that finds the common domain of 3 domains. You're allowed to use decltype, but you get bonus points for a solution that doesn't. Bonus also for instantiating fewest templates. The challenge is for the ternary case, but your solution should scale to N domains.
Here's mine. It's decltype based, but I guess it could be sizeof based in C++03. Regards, -- Daniel Wallin BoostPro Computing http://www.boostpro.com