Not: remove_const<deref>::type
ben beklenebilir int
olarak, değişken const int
değilmiş gibiNeden std :: remove_const const niteleyicisini kaldırmıyor? Sadece hataları okunabilir türlerini almak için <code>std::thread</code> kullanmak
int main() {
const int * first;
using deref = decltype(*first);
std::thread s = std::remove_const<deref>::type{}; // const int ???
std::thread s2 = deref{}; // const int
std::thread s3 = std::remove_const<const int>::type{}; // int
}
görünüyor.
*first
bir lvalue ifadesi olduğunu
Unvanınız 'remove_reference' söylüyor ama vücudunuzdaki bunu kullanmayın. –
tnx, sabit, orijinal kodda her ikisini de kullanarak karıştırdım :) – NoSenseEtAl
Bunun yerine [this] (http://coliru.stacked-crooked.com/a/bfccfe0a5508f107) kullanmanızı tavsiye ederim. 'std :: thread' yöntemi çünkü' const int & 'gerçek yöntemini gösterir, yönteminiz size aittir ve const int' gösterir. – nwp