I'm basically porting all the mysql-client headers which i
thought would be pretty straight forward but it's taking a
little more thought than i anticipated.
Can I ask why? And the part of code you are asking is from
pthread headers not from mysql.
On Sunday, 13 October 2013 at 21:37:31 UTC, Maurice wrote:
Hello,
Can anybody explain my what is happening here?
enum xxx = true;
struct A {
static if (xxx) ref A opAssign(ref const A a) { return this; }
ref A opAssign(int v) { return this; }
}
struct B {
A a;
So you can use templates, something like this:
bool isConvertableToFoo(T)
{
T i = void;
return is(typeof(Foo(i)) == Foo);
}
void bar(T)(T i) if (is(T : Foo))
{
//some code
}
void bar(T)(T i) if (!is(T : Foo) && isConvertableToFoo!T)
{
bar(Foo(i));
}
I do not test it so it is