https://github.com/reputeless/yesno
https://github.com/reputeless/yesno
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/reputeless/yesno
- Owner: Reputeless
- License: bsl-1.0
- Created: 2021-12-22T08:52:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-22T14:43:57.000Z (over 3 years ago)
- Last Synced: 2025-03-29T11:22:20.910Z (3 months ago)
- Language: C++
- Size: 4.88 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# siv::YesNo
## Usage
```cpp
# include
# include "YesNo.hpp"using siv::YesNo;
using FormatDisk = YesNo;
using WriteLog = YesNo;void DoTask(FormatDisk formaDisk, WriteLog writeLog)
{
if (formaDisk)
std::cout << "Formatting a disk...\n";
if (writeLog)
std::cout << "Writing a log...\n";
}int main()
{
DoTask(FormatDisk::No, WriteLog::Yes);
DoTask(FormatDisk{ false }, WriteLog{ true });DoTask(WriteLog::Yes, FormatDisk::No); // error
DoTask(false, true); // error
}
```## License
siv::YesNo is distributed under the **Boost Software License 1.0**.