« first day (214 days earlier)      last day (4734 days later) » 
00:00 - 16:0016:00 - 00:00

12:08 AM
morning everones
 
Xeo
12:56 AM
Okay, please tell me the user258808 commenting on my answer makes any sense, because maybe I'm just not getting what he wants because of insomnia
3
A: How do I call all functions from sub-classes when they were defined as pure virtual in the super-class?

XeoWell, first - single responsibility principle. That in mind, your archeTest shouldn't manage alle test objects. Just have an (in)famous Manager do that! #include <vector> class TestManager{ std::vector<archeTest*> _tests; public: // either void AddTest(archeTest* test){ _t...

Please.. someone tell me what the user258808 and J.N. want from me... or what they want to achieve in general...
 
 
7 hours later…
8:02 AM
good morning :)
 
Hi Nils
 
spent two hours last night on finding a bug when I finally realized that I forgot to norm a vector
 
Seems familiar as sentiment.
 
5
Q: C++ vector of arrays

beb0sHi, why this works std::pair<int, int> p = {1,2}; std::vector<std::pair<int, int>> vp = { {1,2}, {3,4} }; but this doesn't ? std::array<int, 2> a = {1,2}; // still ok std::vector<std::array<int, 2>> va = { {1,2}, {3,4} }; // this last line fails with: err...

morning all
 
hey
 
8:17 AM
@jalf yello
 
sbi
@Xeo: Stuck me neck out fer ya. HTH.
Morning, @all.
 
"Until then, please excuse me to think of you as the one who isn't getting it." Hehe, love this sentence.
 
@sbi morning
 
sbi
@MartinhoFernandes I was wondering whether this would be a tad too aggressive for SO, but then I thought WTF. :)
 
I won't be surprised if it shows up among the stupid flag spam. But I still like it.
 
8:34 AM
@sbi It's not that bad.
 
another eclipse crash this morning
hrmm
 
@sbi, inheriting with the CRTP may help in building meta-classes for all the derived classes.
 
sbi
8:52 AM
@AProgrammer Yeah, I've been thinking about the same, actually. But I was too lazy to play with it. Only I kept telling myself instead that I got work to do here. :)
 
You just gave the reason for which I haven't written an answer myself.
 
Xeo
mornin @all
 
What? You guys do real work? I thought you just spent all day chatting here ;)
5
 
sbi
@Xeo Mornin' @Xeo.
 
Xeo
8:57 AM
mornin @sbi, and thanks for those comments :)
I'm glad I'm not the only one who sees no sense in their comments
 
What site do you guys use for C++ documentation?
 
Xeo
@StackedCrooked the C++0x FDIS :)
After that the STL headers of my implementation of choice
 
Xeo
Other than that, for me cplusplus.com is usually sufficient
 
Often the one on Dinkumware site. Or the standard when I feel picky.
 
9:08 AM
The standard is not free right?
 
Xeo
nope
300CHF on the official ISO page
which is roughly 300eur
 
Too bad :(
 
Xeo
*will treasure his FDIS
 
sbi
@StackedCrooked I think ANSI once sold the PDF for US$18. I doubt they have stopped to do that. And the BSI published it as a book for reasonable money.
But that's C++03, all.
 
@sbi C++03 is fine. Cool.
 
sbi
9:16 AM
It's £22.72.
 
sbi
@StackedCrooked Wow. That is quite a price increase.
You might want to order the book instead. Maybe as an ebook. :)
 
I don't understand the price difference between the pdf and the book you linked..
 
@sbi That's how I got mine. There is also a PDF of C++03 with change marks from C++98 somewhere in the committee mailing.
 
sbi
@StackedCrooked Different publishers. ANSI != BSI
 
9:19 AM
@sbi Aah, ic
 
The normalization bodies usually price their standard per page without taking much the context into account. Few standards are pertinent to individuals and that is reflected on the price. Then it comes to how much it is possible to make them understand that if they sell a PL language cheaper it will largely be compensated by the volumes. BSI and ANSI got it. ISO no (but perhaps for ISO pricing there is also a desire not to concurrence members).
 
@sbi And you didn't just say that, and if anyone asks, we've never met you before. wink wink nudge nudge
 
sbi
@AProgrammer Except that @Stacked found out that ANSI now takes $381.
@jalf Said what? :)
 
@StackedCrooked When I bough it, I found an oribly priced one and then there was another path in the store which led to a the $18 version.
 
sbi
@AProgrammer @Stacked: Like this: webstore.ansi.org/…
Note: I found it through this: herbsutter.com/2010/03/03/… (which I found by googling for "buy c++ standard pdf").
 
9:25 AM
@sbi, yes. I just found it by entering 14882 in the document number search field.
 
sbi
@StackedCrooked We all know that there are illegal copies about. IIRC, someone here just hinted at that. But we try to refrain from openly linking to those.
 
cpx
hmm is it free?
 
@cpx what the illegal copy?
 
sbi
@cpx The same way a beer is free if you smuggle it by the cashier in the supermarket.
 
cpx
lol
 
9:28 AM
no, a copy of the standard costs money
that's why we're trying to find out where to buy it cheaply
 
@sbi ANSI sold C++98 for $18, 03 is slightly more
 
sbi
@FredNurk It's 30 now, at the link I gave above.
 
@sbi What is the difference between the $30 and the $300 version?
 
@StackedCrooked one costs $270 more
 
sbi
@StackedCrooked I dunno. The price?
 
9:32 AM
@sbi But both are sold as separate products, while they are identical. Doesn't make sens..
 
I accept almost no reason for charging for the standard, except: a nominal (e.g $30) fee keeps it out of the hands of those people that would try to 1) learn from it and 2) needlessly argue about it, so they can 3) get real work done
@StackedCrooked bureaucracy rarely does
 
sbi
@StackedCrooked No, it doesn't. But then we're talking a large bureaucratic apparatus here, so what would you expect?
@StackedCrooked Will someone please give that message the necessary flags so that it disappears?
I think it only needs one more.
 
cpx
oh here he comes..
 
Good morning, @Feeds.
 
sbi
@cpx Thanks!
@MartinhoFernandes Ah, he just came by to delete that message.
 
9:43 AM
@MartinhoFernandes have you worked with ASP.NET webservices?
 
@TonyTheTiger A little. Once. Why, is that too obvious?
 
@MartinhoFernandes no cause I have a query about them and maybe thought you could help
I posted my question in the C# room
 
sbi
@MartinhoFernandes You know, I've looked at your avatar and immediately thought "this is the ASP girl there".
 
@sbi how do you know he's really a she?
 
sbi
@TonyTheTiger Erm. Girls usually are?
 
9:48 AM
@sbi uh? I'm confused...
 
@sbi WHAT?????
 
sbi
@TonyTheTiger That avatar shows a girl, and girls usually are Shes.
 
FYI That's just the guy in the lower right corner in the picture of the Jabberwock.
 
@sbi oh ok, now I parsed without errors :)
 
sbi
@MartinhoFernandes Well, if so, then it's a guy with long hair wearing a skirt. Oh, and a slight budge where a female breast should be. Seems quite fishy to me. :)
 
@sbi lol
 
What's with @sbi and spreading rumours about everyone else being a girl?
 
He targets a just freed position at the IMF :-)
 
And how does everyone know the monkey/ape/orangutan/pick-your-favorite-primate in his avatar is a he?
@AProgrammer ? What's IMF? Not the International Monetary Fund, right?
 
sbi
@MartinhoFernandes What do you mean, "rumors"? I mean, just look at that picture. I think I have made babies with that kind of guys.
 
9:56 AM
@MartinhoFernandes Yes.
 
@sbi If you made babies with that kind of guys... Hmm what does that say about you?
@AProgrammer I don't follow then.
 
sbi
@MartinhoFernandes You wouldn't. But you're free to ask @Konrad or @balpha, who had beer with me.
@MartinhoFernandes That I know a girl when I see one?
@MartinhoFernandes The IMF's chief is charged with attempting to rape a room service girl, and the IMF is searching for a successor for his chair. However, I'm not sure what @AProgrammer refers to either, because the room service was a girl.
 
@sbi, I was alluding to that.
 
Oh, so we have a rapist deciding the economic future of my country. Hmmm....
 
10:03 AM
@MartinhoFernandes pretty scary huh?
 
I don't know how much noise is make about that elsewhere, but here in France they write hardly about anything else. (DSK was also seen as a candidate to next year presidential election, even if he hadn't declared himself officially).
 
@AProgrammer might have a been setup then to get him out of the election candidate list
 
@TonyTheTiger Yeah, they set him up. They sent a hot room service girl to his room. He did the rest.
 
Some in France want to believe that. But he was know to like women and it isn't the first time he is accused to have crossed the line (but never so far AFAIK).
 
@MartinhoFernandes hahah
 
10:04 AM
@MartinhoFernandes Alice fights the Jabberwocky in the sequel to Alice's Adventures in Wonderland; that is a picture of Alice
 
sbi
@MartinhoFernandes Actually, he never decided the economic future of any country. Well, at least not directly. That's what the "I" in IMF stands for, after all. And then he's not deciding any economics anymore right now, except maybe how to pay his lawyer. Finally, attempted rape is a harsh accusation with no proof so far.
 
@FredNurk @sbi, see, it's a picture of Alice. Not me.
 
sbi
@MartinhoFernandes I never said it was. It was @Tony who misinterpreted my message to that effect.
 
Oh, yeah. Sorry about spreading rumours about you spreading rumours then.
 
@MartinhoFernandes lulz
 
10:07 AM
And btw, I think you're totally spot on about Xeo. :P
 
@sbi my interpreter has some known bugs :)
we do have a known C++ women on SO
 
sbi
@MartinhoFernandes Why do you think so?
 
No reason. Just adding to the confusion to help you spread the rumours.
 
while(true) { spread(rumors); }
 
sbi
@TonyTheTiger Actually, most compilers will issue a warning for that. OTOH, for(;;) spread(rumors); won't. :)
 
10:25 AM
Oh no, it's flag wars again.
 
passing an initializer list literal to a template, as in stackoverflow.com/questions/6042034/…, does work, right?
> Now that I know that singleton is forbidden word for all possible scenarios I wish I had incorporated a goto in answer as well. – Dialecticus
 
@FredNurk It does ideone.com/ClK3v
With warnings though.
 
@MartinhoFernandes I was loathe to try current compilers for testing whether this should work :)
 
@sbi why?
 
@MartinhoFernandes an (icky) overload fixes even that: ideone.com/wV5NO
 
10:34 AM
@FredNurk Yes, but there is no doubt that version should work, right?
 
interestingly, Dialecticus' singleton answer got -2, but the accepted answer is the same (in more words) and got +2 & accepted
@MartinhoFernandes that's my current thinking; I'm skeptical that the C const& gets deduced correctly -- that gcc shows a warning for it isn't encouraging
 
sbi
@TonyTheTiger Usually it's something like "condition is constant." (Which make sense to warn about when the condition is not obviously constant, but not when it is a bool literal.)
 
Today I met a nice vending machine. I inserted 1€ to pay for an item whose price was 1€, and it gave me that item, and 1€ of change.
 
did you buy another item?
 
Xeo
@MartinhoFernandes I also want to meet such a nice vending machine!
 
sbi
10:37 AM
@MartinhoFernandes And can she cook, too? :)
BTW, @Xeo:
30 mins ago, by Martinho Fernandes
And btw, I think you're totally spot on about Xeo. :P
 
Xeo
<ignore_mode>
 
@FredNurk Why didn't I think of that? It's so obvious... Dammit.
 
Xeo
Please someone tell me the following code is not as bad as I feel about it :(
2
A: Constructing "array" of noncopyable objects.

XeoThis may seem like totally crazy (and it probably is), but... struct ThreadInitValues{ // your actual params int i; float f; }; struct Thread{ Thread(int i = _init.i, float f = _init.f) : _i(i) , _f(f) {} static ThreadInitValues _init; private: // uncopyable ...

 
What's up
?
 
@Nils the ceiling, the sky, airplanes flying
 
Xeo
10:51 AM
@Nils ( 0 1 0 )
 
in .NET when would you use Int32 or Int64 types over just Int?
 
@TonyTheTiger There is no Int.
 
Xeo
@TonyTheTiger use int whenever possible
 
@MartinhoFernandes what do you mean?
 
In C# there is int, which is just an alias to System.Int32, and long which aliases System.Int64.
Use the C# aliases all the time.
 
Xeo
10:54 AM
@MartinhoFernandes Not really. int is a true built-in type while Int32 is a class
 
@Xeo Nope. System.Int32 is a magic value type. int is an alias. Let me find the question.
91
Q: C#, int or Int32? Should I care?

Graham MillerFrom my understanding int and Int32 are the same thing in C#, but I've read a number of times that int is preferred over Int32 but without any reason given. So, what is the reason? Should I care?

The only reason not to use the aliases is to make it clear you're caring about the bitness.
 
Xeo
Meh, never trust the teachers...
 
@Xeo oh your teacher told you that?
 
Xeo
Yeah
 
@Xeo he sucks
 
Xeo
10:59 AM
@TonyTheTiger Not really, maybe he just isn't as versed in C# as in C++
 
@Xeo Was he teaching C# or C++?
I've had my fair share of teachers who had absolutely no idea what they were talking about, about their respective subject matter.
 
Xeo
@MartinhoFernandes Generelly a C++ teacher (and also coder, he's one from Bitfield, who make nintendo DS games)
though he also knows some C#, but not quite as good as C++ though it seems
 
Ok, that's fair.
Also, it's preferable to use the non-C#-specific names (Int32, Int64) in documentation. Other languages may have different names for these types. Using the framework names makes the docs more "portable".
 
11:57 AM
hi
 
sup
 
hello
what's new?
 
Xeo
@TonyTheTiger everything that's got to be deleted again
 
@Xeo hahaahaha :P
 
12:06 PM
lol
 
why do I feel std::forward, rvalue-refs, and such make generic code more cumbersome rather than less?
@DeadMG: I'm unsure whether the variadic syntax with std::forward is correct there
 
because you weren't going to have to overload that function for both const and non-const ref anyway
and I'm fairly sure it's correct
and you're not looking at the performance picture of doing this too- you just made your function O(n) instead of O(n^2)
 
@FredNurk Perfect-forwarding is a win when you avoid the 2^arity overloads.
 
12:22 PM
perfect forwarding is more verbose, but it's O(n) code for N arguments, whereas previously it would have been O(2^n), and O(3^n) if you wanted to add rvalue refs too
 
12:58 PM
0
Q: Beginning generically, plus decltype considering local using-declaration

Fred NurkC++0x's ranged-for loop has a special exception to handle arrays (FDIS §6.5.4), and there are two functions, std::begin and end, which are overloaded to handle arrays or to select begin/end methods. This leads me to believe a function accepting a generic sequence could be written to match a rang...

 
@FredNurk Some types appear unqualified
A c[42]; => ns::A c[42];
It's just that one time I think
 
thanks
 
rlc
1:17 PM
@FredNurk so you need the return type of whatever function called begin is found by ADL, and you want to find it without pulling the using out of the function, right?
 
@rlc right
 
rlc
that's a nice puzzle :-)
 
Almost done with my answer
 
I think I have a solution (per my first comment), but it's ... ugly
 
I found two-ish solutions so it's taking some time
 
1:19 PM
I both don't want to taint people's perception/thought-process nor deny someone the chance to answer if they come up with it, so I'm waiting before adding it
 
Xeo
I somehow have a solution abusing overload resolution and SFINAE at once, but ...
it's not quite clear in my mind xD
 
why is initializer_list<T>::iterator a T const*?
I'd expect T*
 
@FredNurk One solution while I'm poring over the FDIS
 
Xeo
Why would you want to change the content of the initializer list?
 
@FredNurk initializer_lists are designed to be similar with string literals in some respects
 
1:26 PM
@Xeo various reasons, simplest example may be filtering and passing on
 
In this case I believe it is to allow an implementation to place the contents of the list in the same storage as string literals
 
some_func(apply_f_on_each(f, {1, 2, 3}))
@LucDanton that's not how initializer_lists work
each initializer_list has an associated array with a matching lifetime
the initializer_list is merely a wrapper to a pair of pointers (begin, end) for that array
 
@FredNurk Which can, in some times, be the whole program
so in that case might as well place it with the strings
gcc is planning to make the begin and end members constexpr to boot
 
that wouldn't be useful
the whole point of initializer_list is you don't know the size in advance, so the same function can work on a varying number of values
 
(size would also need to be constexpr)
You can use a constexpr function in a non constant context, too
So it doesn't remove anything
The idea being to use initializer_lists in constexpr functions
 
1:32 PM
ah
 
esp. constructors I imagine
 
I guess I still don't know much about constexpr ramifications
 
well
Given int f();
You know where you can use f already
If it's in fact constexpr int f();
Then you can do e.g. long array[f()];
having a function constexpr enables one to use it in constant contexts
 
what about constexpr int f2(int n);
 
For this reason inside the body of a constexpr function the parameters are not constexpr's
 
1:34 PM
T array[f2(42)] would work, what about int n; cin >> n; cout << f2(n)?
 
Fine
As if it was not declared constexpr
What you cant do with constexpr is
constexpr void f(int i) { static_assert( i != 0, "" ); }
 
I think I understand that
but I still don't see why it implies non-const list_initializer::begin returns a const_iterator
 
It doesn't
 
some_func(apply_f_to_each(f, {1, 2, 3})) seems a reasonable use-case, but it's prevented by iterator == const_iterator
apply_f_to_each is more or less std::transform
 
Assuming f or some_func work with iterators you mean?
 
1:42 PM
let's say void f(int &n) { n += 2; } and template<class C, class F> C apply_f_to_each(F f, C &&c) { for (auto &x: c) f(x); return c; }
 
righto
 
I'm not sure if that should be C c instead of C &&c (using reference collapsing)
but initializer_lists use reference semantics when copied anyway, so moot here
 
Perfect forwarding seems appropriate here
 
you missed off some forwarding semantics too
void f(int &n) { n += 2; } and template<class C, class F> C&& apply_f_to_each(F f, C &&c) { for (auto &x: std::forward<C>(c)) f(x); return std::forward<C>(c); }
 
Only forward once
because it could be a move
so forward the return but not before
 
1:45 PM
not in the range-based for
no wait, I don't really know the specs for that
 
Even if it's true, it's unneccessary
 
but you have an rvalue reference, that could point to an rvalue, but you've passed it in to range-based for as-is, which means it treats it as an lvalue, even though it might actually be an rvalue
 
What I said if for the general case
Value category is a property of expression
 
@DeadMG I see no problem using for (...: c)
 
It doesn't matter what C&& c was bound to
c is an lvalue and that's fine
 
1:46 PM
c is, after all, an lvalue within that function
 
forward is here to potentially move c once we're done with it, depending on what we received in the first place
 
plus, how do you select copy-if-lvalue/rvalue-ref-otherwise?
apply_f_to_each should either disallow being called on const lvalues or accept that parameter by value
while it could potentially forward an rvalue (or return a copy, for those that hate the remote possibility of a dangling reference...), as in returning an rvalue-ref
 
@FredNurk After looking around I thought I had another solution to your question but it seems I misremembered some rules on constexpr functions that do not apply to lambdas
It was discussed that they should so the following would be well formed:
[](C& c) { using std::begin; return begin(c); } // return type is deduced
That would have helped you but it's not possible
 
hmm, that should've been "plus, how do you select copy-if-const-lvalue / ref-if-non-const-lvalue / rvalue-ref-otherwise?"
sneak-peak at what I've come up with for my question: ideone.com/X8JSR
in particular, namespace my_detail can't be nested within my::
 
I don't see the need for the const overload
which after all you didn't use for the array overloads
 
1:56 PM
I followed std::begin, but I was thinking the same thing
std::begin/end have the same 3 non-const/const/array overloads each
 
What spec did you use?
 
FDIS
 
Mmh
Must be something smart going on then
 
§24.6.5
assuming no problems with my implementation and that it's actually needed, I can't help but wonder why std::begin/end weren't implemented this way -- unless it was just an oversight, but the special exception for ranged-for shows someone realized this is an issue at some point
 
Right but in your case since you're delegating to std::begin you could use perfect forwarding if you so desire
I assume it's for clarity, decltype(std::forward<C>(c).begin()) isn't nice
 
1:59 PM
I think that might make errors more obtuse
 
Even then it doesn't have the same semantics e.g. what with rvalue *this overloads
 
since the error would be inside my_detail::_begin, instead of the code which calls my::begin
 
In any case an implementation would be free to provide only one begin that does the same
 
@LucDanton eh? I don't think so, that changes semantics
 
A really smart begin that is
 
2:01 PM
implementations can add methods, but not overloads of free functions, iirc
 
In that case it would remove overloads
Not allowed either?
 
oh, you mean combining const and non-const
 
Yes (I'm assuming this is possible but I don't want to contemplate how)
 
I thought you meant including the point of my::begin, which always selects the "right" begin
hmm, "using my::begin" at global scope would change the meaning of my_detail::_begin, and either violate the ODR, ambiguous overload compile-error, or lead to infinite recursion
 
rlc
@FredNurk I'd bet on infinite recursion
I still think a range_traits class is in order
but I don't have time to work one out
 
2:06 PM
I don't want to require unknown UDTs to specialize a traits just so I can call their begin/end methods
 
rlc
@FredNurk I can understand that
 
And trying to provide a reasonable default results in trying to answer the question
(unless the reasonable default is qualified call to std::begin)
 
rlc
I'm pretty sure you could work out a range_traits class that wouldn't often need specialization, though
 
the basic lookup required is 1) if array, use std::begin(c), 2) if found through ADL, use begin(c), 3) otherwise use std::begin(c)
@rlc: #2 would be the general case, and I don't see how to do that in a traits without specialization
 
rlc
@LucDanton a reasonable default would try to define the iterator type of any given range type
 
2:09 PM
My standard for a reasonable default needs an answer from Fred's question so I can deduce that type :)
 
rlc
@FredNurk 1) check whether it's an array (if so, you know the iterator type already) 2) check whether there's an iterator typedef (if so, take it) 3) fail
if you have a library in which your iterator typedef would be different, 3) would be to try it (e.g. Iterator in stead of iterator)
 
honestly, I hate nested types like "iterator"
 
I believe std::pair and std::tuple<T, U> are begin/end compatibles
 
I only accept them in current c++ because we don't have 0x's auto
 
rlc
@LucDanton then 3) would be to take tuples
@FredNurk nested typedefs are often useful for meta-programming
 
2:11 PM
I think the point of the question is: "is there a readily available meta-programming solution/convention for my generic programming needs"
 
@rlc sure, within your own code not using external types, but you point out a key problem with "if you have a library in which your iterator typedef would be different"
 
I understand why Fred wouldn't being interested in too much meta-programming for this one
 
rlc
@FredNurk I agree - that is a common problem with meta-programming
 
should we forevermore treat "iterator" as a reserved name when nested in a type to always mean 98-style iterators?
 
rlc
@FredNurk personally, I would not be ready to drop the iterator concept
I agree there are flaws in 98 iterators, though
serious ones at that
 
2:13 PM
I'd fiercely resist dropping 98 iterators, but I also want to allow room for growth
it's not the concept embodied in 98 iterators that I dislike, but the treatment of "T::iterator" as a reserved name
 
rlc
@FredNurk I see it more as a convention
 
also, I think this is solvable without requiring "T::iterator" :) (see my sneak peak above)
 
rlc
like T::type is a convention in meta-programming in general
@FredNurk I saw your sneak-peek. It's nice, but it has its own limitations
 
please, point out if you see a way it fails to satisfy:
9 mins ago, by Fred Nurk
the basic lookup required is 1) if array, use std::begin(c), 2) if found through ADL, use begin(c), 3) otherwise use std::begin(c)
 
rlc
using namespace my
 
2:17 PM
you mean at global scope?
 
rlc
you said it yourself a few minutes ago...
 
I'm increasingly of the opinion that if you put either using declarations or directives at global scope, you deserve what you get
where before that was just using directives
"using my::begin;" in your own namespace won't affect my_detail::_begin
 
rlc
they can be useful sometimes, and your opinion goes against what people like Sutter and Alexandrescu teach (or used to teach, anyway)
 
The only problem I see with the solution is that you can't reuse the my namespace for containers (which of course can be completely acceptable)
 
@rlc write everything except main() in your own namespace, use using-declarations/-directives however you please; then this problem never occurs
@LucDanton that is a good point
main(), of course, is int main(int argc, char **argv) { return my_ns::main(argc, argv); } in that situation, so you never really have code that lives at global scope, and the global scope ideally just contains namespaces
 
rlc
2:22 PM
@FredNurk my main tends to be a wee bit larger than that, but not much, except in the most trivial of projects
 
@LucDanton if you overload my::begin and my::end for your container types, they'd be selected
 
@FredNurk Could be acceptable too
 
rlc
and except when prevailing coding guidelines explicitly tell me not to use good practice (which happens)
but I agree one shouldn't muck around in the global namespace
point is: that is not the most common point of view (regrettably) and you can't always tell your customers to fix their code
 
also, I'm saddened that my AUTO_RETURN macro isn't in the standard :(
I see no real reason functions with an auto return type that are defined at first declaration and only have one return statement couldn't automatically use it
and, if they did, that would solve the "can't apply local using declarations to return-type decltype" problem
@rlc true, practicality sucks :(
 
Yes, unifying the deduced return type synax and the expanded rules for constexpr functions would make it possible to use the same function body for either a lambda (without return type), an auto function, and an auto constexpr function (with a bit much more than a return statement in it)
 
2:28 PM
god, I would hate to write the compiler code that handled that, though
 
if [](C& c) { return std::begin(c); } already works... :)
 
2:44 PM
I'd say just wrap it all in a class that's smart about selecting from indices when you don't have that ability. It could manage iterators to commonly used positions if data can't move, manage an iterators of last position moved, and determine what the closest path to the objective index is.

Problems solved.
If someone doesn't like using iterators, whatever they do, the appropriate implementation using iterators is applied.
 
 
1 hour later…
Xeo
3:52 PM
I'm way too sleepy, and as such, I'm off for today. See you tomorrow guys
 
night night :P
 
00:00 - 16:0016:00 - 00:00

« first day (214 days earlier)      last day (4734 days later) »