是否有可能做一些这样的:我可以在结构上创建访问器来自动转换为/从其他数据类型?
struct test
{
this
{
get { /*do something*/ }
set { /*do something*/ }
}
}
所以,如果有人试图做到这一点,
test tt = new test();
string asd = tt; // intercept this and then return something else
我不明白的问题。 – 2010-03-01 02:54:08
@John Knoeller:更新了问题 – caesay 2010-03-01 02:58:04
听起来像是你想要一个转换操作符... – Shog9 2010-03-01 02:58:40