mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
fix polymorphic functor
This commit is contained in:
parent
ac5ac257e6
commit
53b99b25f8
9 changed files with 60 additions and 47 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue