Skip to content

Reputeless/YesNo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

siv::YesNo

Usage

# include <iostream>
# include "YesNo.hpp"

using siv::YesNo;
using FormatDisk = YesNo<struct FormatDisk_tag>;
using WriteLog = YesNo<struct WriteLog_tag>;

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages