-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vladimir Batov
authored and
Vladimir Batov
committed
Mar 16, 2024
1 parent
79984a5
commit 4fb6074
Showing
4 changed files
with
41 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <boost/convert.hpp> | ||
#include <boost/convert/charconv.hpp> | ||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
auto cnv4 = boost::cnv::charconv(); | ||
std::string PuNum = "2"; | ||
auto optPuNum = boost::convert<size_t>(PuNum, cnv4); | ||
|
||
if (optPuNum) | ||
std::cout << *optPuNum << "\n"; | ||
else | ||
std::cout << "nullopt\n"; | ||
|
||
return 0; | ||
} |