jeudi 21 juillet 2016

Is libstdc++ wrong to reject assignment of volatile rvalue to std::ignore?

I noticed that libstdc++'s implementation of std::ignore takes a const T& argument, which can't bind to a volatile rvalue. Hence the following code fails to compile:

#include <tuple>
#include <utility>
struct C {};
using VC = C volatile;
int main() {
    std::tuple<VC> t;
    std::tie(std::ignore) = std::move(t);
}

(http://coliru.stacked-crooked.com/a/7bfc499c1748e59e)

Is this in violation of the standard, or is there a clause that renders this undefined behaviour?

Aucun commentaire:

Enregistrer un commentaire