Browse Source

Make dsp::convert() default template deleted. Add trivial implementation.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
94f0070abd
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      include/dsp/convert.hpp

+ 6
- 2
include/dsp/convert.hpp View File

@@ -24,10 +24,14 @@ static_assert(sizeof(Int24) == 3, "Int24 type must be 3 bytes");


/** Converts between normalized types.
Default implementation is the default cast.
*/
template <typename To, typename From>
To convert(From x) {return x;}
To convert(From x) = delete;


/** Trivial conversions */
template <>
inline float convert(float x) {return x;}


/** Integer to float */


Loading…
Cancel
Save