operations erratic value types


this describes way, c#, grant offer erratic value forms have + user tangible them. idea allows following code:



public t add(t val1, t val2)
{
relapse val1 + val2;
}


this formula does accumulate there pledge t form construction '+' operator, nonetheless outcome achieved formula this:



public t add(t val1, t val2)
{
//num<t> defines '+' operation advantage value form t
relapse (new num<t>(val1) + new num<t>(val2));
}


follow couple num category achieves this. anyways, question. there any proceed grasp same outcome c c++? curious, problem i'm perplexing solve grant cuda heart some-more flexible/general permitting work some-more types.



update: .net, marc gravell finished solves user problem unequivocally elegantly.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

using mvc, should hoop communication between views? between models?