Skip to content

MurakamiShun/MacrolessNamedParameter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MacrolessNamedParameter

C++20 Macro less named parameter library.

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

using namespace MacrolessNamedParameter;

void func(Arg<"first", int> first, Arg<"second", int> second){
    std::cout << std::string_view(first.name) << ":" << first.value
       << "," << std::string_view(second.name) << ":" << second.value << std::endl;
}
void func(Arg<"second", int> second, Arg<"first", int> first){
    std::cout << std::string_view(first.name) << ":" << first.value
       << "," << std::string_view(second.name) << ":" << second.value << std::endl;
}

int main() {
    const int a = 99;
    func("first"_arg = a, "second"_arg = 88);
}

License

This software is released under the MIT License, see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages