File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
6
6
set (NOT_SUBPROJECT TRUE )
7
7
endif ()
8
8
9
+ set (CMAKE_CXX_STANDARD 17 )
10
+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
11
+
9
12
# Initialize CPM.cmake
10
13
include (cmake/CPM.cmake )
11
14
Original file line number Diff line number Diff line change 3
3
#include < memory>
4
4
#include < ostream>
5
5
#include < string>
6
+ #include < string_view>
6
7
#include < utility>
7
8
8
9
namespace errors {
@@ -27,7 +28,7 @@ class Error {
27
28
* std::cout << err << std::endl;
28
29
* @endcode
29
30
*/
30
- std::string message () const ;
31
+ std::string_view message () const ;
31
32
32
33
friend Error make (const std::string& msg);
33
34
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ namespace errors {
4
4
5
5
Error::Error (const std::shared_ptr<const std::string>& message_ptr) : message_ptr(message_ptr) {}
6
6
7
- std::string Error::message () const {
7
+ std::string_view Error::message () const {
8
8
if (!message_ptr) return " no error" ;
9
9
return *message_ptr;
10
10
}
You can’t perform that action at this time.
0 commit comments