Skip to content

Commit 153521c

Browse files
authored
Add files via upload
1 parent a0fe0ca commit 153521c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

C++/Complex Linux/Complex/Module.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,18 @@ inline std::vector<double> ToNumbers(const std::wstring& Val, const Terms& Trm)
154154
while (std::regex_search(Suf, End, Mat, Reg, Flg))
155155
{
156156
if (Mat.prefix().matched) { throw std::invalid_argument{ "The string is invalid." }; }
157-
std::wsmatch::const_reference BegV = Mat[BegI];
158-
std::wsmatch::const_reference SigV = Mat[SigI];
159-
std::wsmatch::const_reference TrmV = Mat[TrmI];
160-
std::wstring Cap(BegV.first, SigV.second);
157+
std::wstring BegV = Mat.str(BegI);
158+
std::wstring SigV = Mat.str(SigI);
159+
std::wstring TrmV = Mat.str(TrmI);
160+
std::wstring Cap{ BegV + SigV };
161161
std::size_t i{ 0 };
162-
if (Trm.Null()) { i = stos_t(std::wstring(TrmV.first + 1, TrmV.second)); }
162+
if (Trm.Null()) { i = stos_t(TrmV.substr(1)); }
163163
else
164164
{
165165
while (Trm[i] != TrmV && i < Siz) { ++i; }
166166
if (i == Siz) { throw std::runtime_error{ "The branch should unreachable." }; }
167167
}
168-
if (!SigV.matched && !TrmV.matched) { throw std::invalid_argument{ "The string is invalid." }; }
168+
if (SigV.empty() && TrmV.empty()) { throw std::invalid_argument{"The string is invalid."}; }
169169
else if (Cap.empty() || Cap == L"+") { ++Num[i]; }
170170
else if (Cap == L"-") { --Num[i]; }
171171
else { Num[i] += stod_t(Cap); }

0 commit comments

Comments
 (0)