Skip to content

Commit f82fc5d

Browse files
committed
#62 - Implement exception CppStringT::NotFoundException
Completed.
1 parent 224de07 commit f82fc5d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cpp-strings/cppstrings.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
//=============================================================
2424
#include <algorithm>
2525
#include <cctype>
26+
#include <stdexcept>
2627
#include <string>
2728
#include <vector>
2829
//#include <initializer_list>
@@ -106,6 +107,16 @@ class CppStringT : public std::basic_string<CharT>
106107
CppStringT(const StringViewLike& svl, size_type pos, size_type n) : MyBaseClass(svl, pos, n) {}
107108

108109

110+
//=== Exceptions ======================================
111+
class NotFoundException : public std::logic_error
112+
{
113+
public:
114+
using MyBaseClass = std::logic_error;
115+
116+
inline NotFoundException(const std::string& what_arg) : MyBaseClass(what_arg) {}
117+
inline NotFoundException(const char* what_arg) : MyBaseClass(what_arg) {}
118+
};
119+
109120
//=== Methods =========================================
110121

111122
//--- capitalize() ------------------------------------

0 commit comments

Comments
 (0)