fix polymorphic functor

This commit is contained in:
bolero-MURAKAMI 2013-02-08 01:14:42 +09:00
parent ac5ac257e6
commit 53b99b25f8
9 changed files with 60 additions and 47 deletions

View file

@ -10,14 +10,23 @@ namespace sprout {
//
// phase_value
//
template<typename T>
template<typename T = void>
class phase_value {
public:
typedef typename T::value_type result_type;
typedef T argument_type;
public:
SPROUT_CONSTEXPR phase_value() {}
SPROUT_CONSTEXPR typename T::value_type operator()(T const& value) const {
SPROUT_CONSTEXPR typename T::value_type
operator()(T const& value) const {
return sprout::phase_spectrum_value(value);
}
};
template<>
class phase_value<void> {
public:
template<typename T>
SPROUT_CONSTEXPR typename T::value_type
operator()(T const& value) const {
return sprout::phase_spectrum_value(value);
}
};