You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I'd like to have a templated class with an iterator-class as a template
-parameter. And internally the class should have a vector having the
element-type the iterator "points" to.
I could write vector<decltype(*it)> when it is a iterator-instance.
But I'd like to have something like vector<decltype(*IteratorType)>.
Theoretically the compiler could deduce the type of *IteratorType
by analyzing the operator * of IteratorType. Even there's the issue
that this type would be a refernce this could work by writing
vector<decltype(remove_reference<*IteratorType>::type). But the
standard doesn't allow all this.
So is there a clever way arround this mess?
Alf P. Steinbach
unread,
Apr 8, 2019, 5:34:02 AM4/8/19
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Not so clever: `decltype` + `std::declval` + `std::remove_reference_t`.