Home » U++ Library support » U++ Core » Question about SubRange.
Re: Question about SubRange. [message #49221 is a reply to message #49218] |
Mon, 08 January 2018 15:55 |
Novo
Messages: 1358 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Mon, 08 January 2018 05:52
Not true (not in U++ nor STL). That is basically a reason for those 2 overloads. E.g. try Sort with just const variant...
The "C& c" variant is definitely not needed. The "C&& c" variant is an universal reference and it is a complete replacement of the "C& c" variant. I tried to compile TheIDE with "C& c" commented out and it compiles just fine.
The problem with the "const C& c" variant is that when you try to construct the SubRangeClass you get a SubRangeClass<const I> version.
I tried to strip the constness like below
template <class I>
SubRangeClass<I> SubRange(I l, I h)
{
return SubRangeClass<typename std::remove_const<I>::type>(l, h);
}
template <class I>
SubRangeClass<I> SubRange(I l, int count)
{
return SubRangeClass<typename std::remove_const<I>::type>(l, count);
}
But I'm still getting weird compilation problems with TabBar::Tab.
And I'm still a little bit confused about what is IterSwap for. What is wrong with the regular Swap?
Something is not right about all this ...
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Sat Apr 27 09:15:16 CEST 2024
Total time taken to generate the page: 0.02361 seconds
|