joboccara / NamedType

Implementation of strong types in C++
MIT License
766 stars 85 forks source link

do the arguments require the correct order? #84

Closed Tasheehoo closed 1 year ago

Tasheehoo commented 1 year ago

hi,

using this sample code:

using FirstName = NamedType<std::string, struct FirstNameTag>;
using LastName = NamedType<std::string, struct LastNameTag>;

static const FirstName::argument firstName;
static const LastName::argument lastName;

void displayName(FirstName const& theFirstName, LastName const& theLastName)
{}

// Call site
displayName(lastName = "Doe", firstName = "John");

it looks I can't swap args order because of compiler error. should it be so? or am I doing smth wrong?

Tasheehoo commented 1 year ago

i found this one: github.com/niXman/named-args