diff --git a/include/etl/array.h b/include/etl/array.h index 584a69bc..fa7ee844 100644 --- a/include/etl/array.h +++ b/include/etl/array.h @@ -561,14 +561,14 @@ namespace etl -> array && ...), T>, 1U + sizeof...(Ts)>; #endif -#if ETL_CPP11_SUPPORTED - template - constexpr auto make_array(T&&... t) - -> etl::array, sizeof...(T)> - { - return { { etl::forward(t)... } }; - } -#endif +//#if ETL_CPP11_SUPPORTED +// template +// constexpr auto make_array(T&&... t) +// -> etl::array, sizeof...(T)> +// { +// return { { etl::forward(t)... } }; +// } +//#endif //************************************************************************* /// Overloaded swap for etl::array diff --git a/include/etl/basic_string_stream.h b/include/etl/basic_string_stream.h index c80c8660..e464429e 100644 --- a/include/etl/basic_string_stream.h +++ b/include/etl/basic_string_stream.h @@ -46,6 +46,7 @@ namespace etl typedef TFormat format_spec_type; typedef TIString istring_type; typedef typename TIString::value_type value_type; + typedef typename TIString::pointer pointer; typedef typename TIString::const_pointer const_pointer; //************************************************************************* @@ -218,7 +219,17 @@ namespace etl } //********************************* - /// From a const pointer to a string + /// From a character pointer to a string + //********************************* + friend basic_string_stream& operator <<(basic_string_stream& ss, pointer p) + { + TStringView view(p); + ss << view; + return ss; + } + + //********************************* + /// From a const character pointer to a string //********************************* friend basic_string_stream& operator <<(basic_string_stream& ss, const_pointer p) { diff --git a/test/test_array.cpp b/test/test_array.cpp index ca4fd04d..96543c95 100644 --- a/test/test_array.cpp +++ b/test/test_array.cpp @@ -646,12 +646,12 @@ namespace } //************************************************************************* - TEST(test_make_array) - { - auto data = etl::make_array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); + //TEST(test_make_array) + //{ + // auto data = etl::make_array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); - CHECK_EQUAL(5, data[5]); - } + // CHECK_EQUAL(5, data[5]); + //} }; } diff --git a/test/test_string_stream.cpp b/test/test_string_stream.cpp index 71954033..c0361807 100644 --- a/test/test_string_stream.cpp +++ b/test/test_string_stream.cpp @@ -80,7 +80,7 @@ namespace SUITE(test_string_stream) { //************************************************************************* - TEST(test_default_format) + TEST(test_default_format_from_const_char) { String str; @@ -95,6 +95,22 @@ namespace CHECK_EQUAL(String(STR("Hello World 123")), result); } + //************************************************************************* + TEST(test_default_format_from_char) + { + String str; + + Stream ss(str); + + int value = 123; + String hello(STR("Hello")); + ss << hello << const_cast(STR(" World ")) << value; + + String result = ss.str(); + + CHECK_EQUAL(String(STR("Hello World 123")), result); + } + //************************************************************************* TEST(test_custom_format) { diff --git a/test/test_string_stream_u16.cpp b/test/test_string_stream_u16.cpp index 658768ae..cb548697 100644 --- a/test/test_string_stream_u16.cpp +++ b/test/test_string_stream_u16.cpp @@ -80,7 +80,7 @@ namespace SUITE(test_string_stream) { //************************************************************************* - TEST(test_default_format) + TEST(test_default_format_from_const_char) { String str; @@ -95,6 +95,22 @@ namespace CHECK_EQUAL(String(STR("Hello World 123")), result); } + //************************************************************************* + TEST(test_default_format_from_char) + { + String str; + + Stream ss(str); + + int value = 123; + String hello(STR("Hello")); + ss << hello << const_cast(STR(" World ")) << value; + + String result = ss.str(); + + CHECK_EQUAL(String(STR("Hello World 123")), result); + } + //************************************************************************* TEST(test_custom_format) { diff --git a/test/test_string_stream_u32.cpp b/test/test_string_stream_u32.cpp index d8e608b1..58d174b7 100644 --- a/test/test_string_stream_u32.cpp +++ b/test/test_string_stream_u32.cpp @@ -80,7 +80,7 @@ namespace SUITE(test_string_stream) { //************************************************************************* - TEST(test_default_format) + TEST(test_default_format_from_const_char) { String str; @@ -95,6 +95,22 @@ namespace CHECK_EQUAL(String(STR("Hello World 123")), result); } + //************************************************************************* + TEST(test_default_format_from_char) + { + String str; + + Stream ss(str); + + int value = 123; + String hello(STR("Hello")); + ss << hello << const_cast(STR(" World ")) << value; + + String result = ss.str(); + + CHECK_EQUAL(String(STR("Hello World 123")), result); + } + //************************************************************************* TEST(test_custom_format) { diff --git a/test/test_string_stream_wchar_t.cpp b/test/test_string_stream_wchar_t.cpp index a142e3c8..af69a80e 100644 --- a/test/test_string_stream_wchar_t.cpp +++ b/test/test_string_stream_wchar_t.cpp @@ -81,7 +81,7 @@ namespace SUITE(test_string_stream) { //************************************************************************* - TEST(test_default_format) + TEST(test_default_format_from_const_char) { String str; @@ -96,6 +96,22 @@ namespace CHECK_EQUAL(String(STR("Hello World 123")), result); } + //************************************************************************* + TEST(test_default_format_from_char) + { + String str; + + Stream ss(str); + + int value = 123; + String hello(STR("Hello")); + ss << hello << const_cast(STR(" World ")) << value; + + String result = ss.str(); + + CHECK_EQUAL(String(STR("Hello World 123")), result); + } + //************************************************************************* TEST(test_custom_format) {