Browse Source

Make default implementation of dsp::convert() the default cast.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
ad37b1b212
1 changed files with 4 additions and 7 deletions
  1. +4
    -7
      include/dsp/convert.hpp

+ 4
- 7
include/dsp/convert.hpp View File

@@ -16,14 +16,11 @@ struct __attribute__((packed)) int24_t {
static_assert(sizeof(int24_t) == 3, "int24_t type must be 3 bytes"); static_assert(sizeof(int24_t) == 3, "int24_t type must be 3 bytes");




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


/** Trivial conversion */
template <typename To>
To convert(To x) {return x;}
To convert(From x) {return x;}




/** Integer to float */ /** Integer to float */


Loading…
Cancel
Save