|
Boost : |
Subject: Re: [boost] C++11 Metaprogramming
From: Christopher Jefferson (chris_at_[hidden])
Date: 2012-04-02 04:47:35
On 1 Apr 2012, at 22:07, Nathan Ridge wrote:
>
>> From a pure meta-programming perspective, I guess the only real
>> addition is variadic templates.
>> However, there is the problem that they're fairly limited and that one
>> may not expand them as the arguments of a non-variadic template.
>
> I thought that was allowed. At least, GCC supports it since 4.7, and its
> error message for it in 4.6 was
>
> "sorry, unimplemented: cannot expand 'Args ...' into a fixed-length argument list"
>
> which suggests the feature is not an extension.
There is a workaround for this, redirect through another layer of templates
template<template <typename...> T, typename... Args>
struct Join
{ typedef T<Args...> type; };
Chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk