diff --git a/uart.hpp b/uart.hpp index 6107f5d..4cdf059 100644 --- a/uart.hpp +++ b/uart.hpp @@ -9,6 +9,15 @@ namespace uart { +namespace detail { + +template +struct always_false { + static constexpr auto value = false; +}; + +} // namespace detail + template class uart { public: @@ -72,157 +81,187 @@ class uart { return *this; } + template uart &operator<<(char) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(unsigned char) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(short) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(unsigned short) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(int) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(unsigned int) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(long) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(unsigned long) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(long long) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(unsigned long long) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(float) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(double) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(long double) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(bool) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator<<(const void *) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } ////////////////////////////////////////////////////////////////////////// // Input stream overloads + template uart &operator>>(char &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(unsigned char &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(short &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(unsigned short &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(int &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(unsigned int &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(long &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(unsigned long &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(long long &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(unsigned long long &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(float &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(double &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(long double &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(bool &) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } + template uart &operator>>(const void *&) { - static_assert(true, "Not implemented"); + static_assert(detail::always_false::value, "Not implemented"); } };