// TODO注释和其他自定义未显示在Visual Studio 2010(Ultimate,x64,sp1)的任务列表中,甚至在配置中激活选项,如该帖子中所述:
我知道这只适用于有todo注释的已打开文件,但即使打开文件有这些注释,我也会得到一个空列表.
我怀疑这种方法是否可行,假设你想要两种方法同时调用一个函数,一种是返回一个对象而另一种是通过引用返回参数:
// ...
template <class T> void func(Foo<T>& f, const T n)
{
f.a = Something(f.a + n);
f.b = Something(f.b + n);
}
template <class T> Foo<T> func(const Foo<T>& f, const T n)
{
return Foo<T>( Something(f.a + n), Something(f.b + n) );
}
// ...
// main
Foo<int> foo(1, 1);
func(foo, 2);
Foo<int> foo2 = func(foo, 2);
Run Code Online (Sandbox Code Playgroud)
第一个参数中的const字是否影响方法的签名?