Joel Fielder wrote:
> Connection
> connection(ConnectionLoginDetails().Database("whatever").Server("localho
> st").Password("noh4xzorssszz"));
My purpose in doing this isn't because I believe the new parameter order
is the One True Way, it's because I want to reduce typing by eliminating
the need to pass all the parameters. Adding verbosity is exactly the
wrong thing.
I could be talked into something less verbose, but in the same vein,
like this:
class Connection ... {
public:
class TCP {
public:
TCP(host, user, port, etc...);
}
Connection(const TCP& tcp);
#ifdef MYSQLPP_PLATFORM_WINDOWS
class NamedPipes {
public:
NamedPipes();
}
Connection(const NamedPipes& np);
#else
class DomainSockets {
public:
DomainSockets(path);
}
Connection(const DomainSockets& ds);
#endif
}
Usage:
Connection con(Connection::TCP(host, user, port)); Connection
con(Connection::NamedPipes());