X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftemplate5.cc;h=b669abb8994ef59bdbc51216cff3752c293233cb;hb=a995cb68588f9d47868ca6d9ffb3799b3a9d09a2;hp=cbf4f3bfa7b489aba187fb1b3f5777f413b05979;hpb=a276a19dc6bd57832db3107f2f2cbb04cb4677b6;p=lilypond.git diff --git a/lily/template5.cc b/lily/template5.cc index cbf4f3bfa7..b669abb899 100644 --- a/lily/template5.cc +++ b/lily/template5.cc @@ -7,6 +7,8 @@ */ #include "moment.hh" +#include "real.hh" +#include "interval.hh" #include "interval.tcc" @@ -19,6 +21,7 @@ Interval_t::infinity () return infty; } + template<> string Interval_t::T_to_string (Rational a) @@ -27,3 +30,32 @@ Interval_t::T_to_string (Rational a) } template INTERVAL__INSTANTIATE (Rational); + + +template<> +Moment +Interval_t::infinity () +{ + Moment infty; + + infty.main_part_.set_infinite (1); + return infty; +} + + +template<> +string +Interval_t::T_to_string (Moment a) +{ + return a.to_string (); +} + +template INTERVAL__INSTANTIATE (Moment); + +template<> +Real +Interval_t::linear_combination (Real x) const +{ + Drul_array da (at (LEFT), at (RIGHT)); + return ::linear_combination (da, x); +}