Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, making it accept a universal reference would fix it...

...but that requires the argument to be a type from a template D: so you'd have to write:

    template<typename String = std::string>
    void dosomething(String &&str)
...and that's not quite right either, since you'd want it to be either an rvalue reference or a const lvalue reference


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: