|
Boost Users : |
Subject: Re: [Boost-users] Problems using mpl::if_ and function_types::result_type
From: Max Vasin (max.vasin_at_[hidden])
Date: 2011-11-24 09:26:46
Hello, Allan, although I do not know the answer I post some results
that I have got. Your problem has nothing to do with either MPL or
function_types.
First of all declaring function to take a void parameter is
deprecated, the type `void (void)' is in fact `void ()'. When you
declare a function type void (R) where R
depends on a template parameter compiler expects to get an unary
function type but when R is void the function is nullary (and turning
an unary function into
nullary seem to be forbidden). This minimal example demonstates the issue:
template <typename F>
struct A {
typedef void type(F);
};
int main(int argc, const char *argv[])
{
A<int> ok;
A<void> fail;
}
What you need is partial template specialization. And I will wait for
the expert answer.
-- WBR, Max Vasin.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net