Removed unnecessary const qualifiers in template

This commit is contained in:
BlackMark 2019-07-28 14:00:46 +02:00
parent 29b4d85ce3
commit 2bbba0fcbd
3 changed files with 7 additions and 5 deletions

View File

@ -23,7 +23,7 @@ enum class Parity {
namespace detail { namespace detail {
template <const DataBits dataBits> template <DataBits dataBits>
struct choose_data_type { struct choose_data_type {
using type = uint8_t; using type = uint8_t;
}; };
@ -35,8 +35,8 @@ struct choose_data_type<DataBits::NINE> {
} // namespace detail } // namespace detail
template <const uint32_t baudRate = 9600, const DataBits dataBits = DataBits::EIGHT, const Parity parity = Parity::NONE, template <uint32_t baudRate = 9600, DataBits dataBits = DataBits::EIGHT, Parity parity = Parity::NONE,
const StopBits stopBits = StopBits::ONE> StopBits stopBits = StopBits::ONE>
struct config { struct config {
static constexpr auto BAUD_RATE = baudRate; static constexpr auto BAUD_RATE = baudRate;
static constexpr auto DATA_BITS = dataBits; static constexpr auto DATA_BITS = dataBits;

View File

@ -12,7 +12,7 @@ enum class Mode {
SPI, SPI,
}; };
template <const Mode mode, class config> template <Mode mode, class config>
class hardware0 { class hardware0 {
public: public:
using data_t = typename config::data_t; using data_t = typename config::data_t;

View File

@ -1,10 +1,12 @@
#pragma once #pragma once
#include "config.hpp"
#include "../io/io.hpp" #include "../io/io.hpp"
namespace uart { namespace uart {
template <const io::P rxPin, const io::P txPin, class config> template <io::P rxPin, io::P txPin, class cfg = config<>>
class software { class software {
public: public:
using data_t = typename config::data_t; using data_t = typename config::data_t;