를 튜플초기화 튜플은
/usr/include/c++/4.6/tuple:100:4: error: binding of reference to type 'float' to
a value of type 'const float' drops qualifiers
: _M_head_impl(std::forward<_UHead>(__h)) { }
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
//snip...
/usr/include/c++/4.6/tuple:257:11: note: in instantiation of function template
specialization 'std::_Tuple_impl<0, float &, float &, float &>::_Tuple_impl
<float, float, float>' requested here
: _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
^
18 : note: in instantiation of function template specialization
'std::tuple::tuple' requested here
Vec3Ref bar (foo);
^
내가 찾은 가장 가까운 것은 this question이지만, 문제가있는 것 같습니다 값이 std::make_tuple
인 튜플로 초기화하는 것이 좋습니다. 그러나 foo
은 대개는 lvalue입니다. 왜 이것이 작동하지 않습니까? 이 방법과 std::tie
의 차이점은 무엇입니까? 2014년 7월 23일에서
Vec3 & Vec3Ref의 문제점은 무엇입니까? –
@ DieterLücking 지정 가능한 스윕. 어디에도 존재하지 않으면 외부 구조에 대한 참조를 만들 수 없습니다. – Dan
@ShafikYaghmour Clang 3.0.6. – Dan