你能用 BOOST_AUTO 创建一个引用类型吗?

Can you create a reference type with BOOST_AUTO?

例如我想要这样的东西:

std::vector<double> v;

BOOST_AUTO(vref &,v);

但这不起作用

发件人:http://www.boost.org/doc/libs/1_41_0/doc/html/typeof/tuto.html

Both BOOST_TYPEOF and BOOST_AUTO strip top-level qualifiers. Therefore, to allocate for example a reference, it has to be specified explicitly:

string& hello()
{
    static string s = "hello";
    return s;
}

BOOST_AUTO(&s, hello());