« first day (754 days earlier)      last day (4187 days later) » 

1:02 PM
@Xeo died here too
@DeadMG what game are you playing?
 
Prison Architect
 
oh right
he's a new zoo member
 
animals animals
 
class zoo { private: Animal Aardvark; }; <--- He's a member
 
animals that's an album by pink floyd
 
1:04 PM
I like the riff at the end of 'Sheep'.
 
Inconsistent naming, you suck.
 
Xeo
Okay, either SO has some serious DNS problems, or I have with SO's domain.
 
oooh
my stupid guards are putting prisoners in the cell block that's not finished yet
 
@Xeo I don't think it's DNS. I get timeouts.
 
so that's how they're escaping...
 
1:16 PM
3
Q: std::function to std::bind?

user1447257I get a compile error using this: std::vector<std::function<int(int)>> functions; std::function<int(int, int)> foo = [](int a, int b){}; std::function<int(int)> bar = std::bind(foo, 2); functions.push_back(bar); The error i get is: /usr/include/c++/4.6/functional:176...

Can someone help me with this please? I can't find a thing about it.
 
About what?
 
Howdy! Can anyone help me work through what "No Error" from "strerror()" can be caused by?
 
@Incognito There's no error?
 
bloody hell
 
user1804599
@Incognito it's caused by the fact that there is no error.
 
you'd think we're the helpdesk, instead of the chatroom
 
oh.... it;'s not that question, i'm a dumbass...
 
user1804599
@Incognito y u no std::thread.
 
@DeadMG Can you explain what I've done that you're so offended?
@Aardvark Not my code.
 
well, in case you hadn't noticed, this place is the chat.
there's a whole other part of the site for asking questions
 
1:19 PM
@DeadMG lol
 
0
Q: Using std::bind with __stdcall function

Ivan0x32How does one can use std::bind (not boost::bind) on __stdcall function or is it even possible in current implementation? When i try to compile following example: std::function<LRESULT __stdcall(int, WPARAM, LPARAM)> func; func = std::bind(&EventListener::myhook, this, std::placeholders...

 
@DeadMG Other rooms have an established precedence of being able to help with questions. Can you show me how I was supposed to know I've committed a grave transgression against the sanctity of the room?
 
Is it okay to post links to question itself here?
 
@Ivan0x32 std::function<LRESULT(int, WPARAM, LPARAM)> func;
 
@Incognito Hmmm. Normally, there's a giant thing on the starboard saying so, but it does seem to have disappeared. Also, fuck other rooms, who cares what they do?
 
1:21 PM
Oct 23 at 23:53, by Cat Plus Plus
http://loungecpp.wikidot.com/owners%3Anewbie-hints http://loungecpp.wikidot.com/owners%3Anewbie-hints http://loungecpp.wikidot.com/owners%3Anewbie-hints http://loungecpp.wikidot.com/owners%3Anewbie-hints http://loungecpp.wikidot.com/owners%3Anewbie-hints http://loungecpp.wikidot.com/owners%3Anewbie-hints http://loungecpp.wikidot.com/owners%3Anewbie-hints http://loungecpp.wikidot.com/owners%3Anewbie-hints
 
Try tha with __stdcall function.
 
Xeo
Yeah, applying __stdcall to the signature doesn't make much sense.
 
@Ivan0x32 __stdcall has no business in std::function's template argument.
@Ivan0x32 Why would I?
 
Xeo
Since std::function is polymorphic and can store anything.
 
also, it's lunchtime.
 
1:21 PM
If you're new here, read the newbie hints. Thanks!
17
 
You don't want and don't need it there.
 
Xeo
@TonyTheLion Too friendly!
 
@DeadMG Oh, you're the grumpy one in here with lots of knowledge. Just assign that to the room information so people know.
 
@Incognito Other rooms also have an established precedence of flagging a million messages every time two people disagree. This room is not other rooms. :) (A hint is in the name. Other rooms are not named lounge)
 
@Incognito Erm. He's the puppy, what else do you expect? A friendly greeting or a helpful comment. Ain't gonna happen with that puppy.
 
Xeo
1:24 PM
@Incognito Many here are grumpy about people bursting in and dumping questions.
 
Many here are grumpy. FTFY ^
 
Anyway, thanks for the chat folks. I still need to get to the bottom of this so I can't really stick around. Have a great day!
 
KTHXBYE!
 
BAI
 
user1804599
This is our last goodbye.
 
1:26 PM
shush, or I'll have you for breakfast! :P
 
@R.MartinhoFernandes it has nothing to do with that __stdcall in std::function type declaration, even if i declare it as std::function<LRESULT(int, WPARAM, LPARAM)> it gives same errors. I forgot to mention that.
 
user1804599
 
Man, I'm still not used to VS's errors.
 
user1804599
WTF is wrong with people.
 
guess my only option is to use boost::bind for now
 
user1357851
@Aardvark did I not tell you about the buddy system
 
user1357851
should have listened ^_^
 
@Ivan0x32 Anyway, if you want a workaround, instead of the dirty hacks you have, you can just make a passthrough lambda.
 
user1804599
@Telkitty I don’t see how that is even remotely relevant.
 
1:32 PM
Waiiiiit.
What's EventListener::myhook again?
 
user1804599
Hamertime!
 
Static function or instance function?
 
instance
Thats the trick
 
A __stdcall instance function?
WTF.
 
LRESULT __stdcall myhook(int, WPARAM, LPARAM)
yes
 
1:33 PM
Is that even valid?
 
user1804599
Shouldn't you use __thiscall for member functions?
 
Is there even a non-insane reason for that to be valid?
 
I don't know if it works correctly, but it compiles.
 
Do you really need it to compile?
 
user1804599
How are you going to call it? How is this passed?
 
1:36 PM
std::function<LRESULT(int, WPARAM, LPARAM)> func = [this](int a, WPARAM b, LPARAM c) { return myhook(a, b, c); }
Have you tried this?
 
Well if i just call it from ctor it seem to work correctly. Its hook proc, i don't intend to call it myself, it OS (Windows) who will call it.
This above is ccall actually
 
@Ivan0x32 Will Windows pass a this?
 
or any other call-specification which is not stdcall that is needed for Windows api
 
what is an instance function? a member function?
 
user1804599
@Abyx a non-static member function.
 
1:38 PM
not its not, thats why i want to use bind to bind it to current class member
 
@Ivan0x32 And then what? Pass std::function to the Windows API?
That won't work.
 
So how good are you guys at bullshitting people?
 
You need to rethink this whole thing.
You are trying to get an impossible solution working.
 
simple example, someone asks you "How are you doing?" and you feel like absolute shit that moment, do you say "I'm okay" or do you just say it as it is "Shit".
 
user1804599
@TonyTheLion the latter.
 
1:40 PM
yes
I prefer the latter too
 
user1804599
Oh the joys of web development. :(
 
That i didn't think of... looks like i'm going to live without that...
 
there's no "joy" in web development
 
@Ivan0x32 Depending on what WinAPI function you're trying to call, there may be a simple solution.
 
user1357851
1:42 PM
you can collect a lot of user info on your website :x
 
user1804599
I’m considering Python vs Ruby. I cannot choose.
 
SetWindowsHookEx
 
user1804599
@Telkitty stop your evil and suspicious activities.
 
user1357851
:'(
 
user1357851
but thats whats fun in life (just joking)
 
user1357851
1:44 PM
nah I am just curious
 
user1804599
 
Xeo
Slap your teacher, this is just stupid. You should only not be allowed to use std::vector and similar when reimplementing them for learning purposes. — Xeo 9 secs ago
The stupidity of teachers is endless...
 
@Ivan0x32 use a singleton/global variable
 
Xeo
@Aardvark You could've just said "plonk"
 
@Ivan0x32 Oh. That one. I don't think there's an option other than global variables.
 
user1804599
1:45 PM
@Xeo hehe Usenet.
 
That is especially shitty in case of WndProcs with multiple windows.
 
@Ivan0x32 WndProcs are more flexible.
 
user1357851
my favourite C++ joke is: In C++ friends gets access to object's private members.
 
I don't know all the details, but I remember that being discussed here before.
 
plonked
 
1:48 PM
Most WinAPI callbacks allow carrying state around.
 
@Ivan0x32 in that case, you can store this in window's user data. (GWL_USERDATA )
 
@Aardvark javascript!
 
user1804599
Hmm. I could use Node.js indeed.
 
> hardly any strands will care about damage.
This API is so funny.
 
sbi
Hi.
Does anybody see anything wrong with this:
template<class Owner>
class ref_counted
{
public:
	ref_counted()                       : m_ref_count(new unsigned long()) {}
	~ref_counted()                        {if(!(*m_ref_count)--) delete m_ref_count; }

	ref_counted(const ref_counted& that)  {m_ref_count=that.m_ref_count; ++*m_ref_count;}
	void operator=(ref_counted that)      {std::swap(m_ref_count, that.m_ref_count);}

	bool is_last_referrer() const         {return *m_ref_count == 0;}
private:
	unsigned long*                        m_ref_count;
That was fast.
 
1:50 PM
@sbi weird formatting
 
@sbi I was trying to sneak it in before you posted the actual thing :)
 
sbi
@R.MartinhoFernandes Oh, I'd never guessed that!
 
@sbi I assume thread safety isn't a concern?
 
sbi
@Abyx Half of that is my standards, half of it I gotta do that way.
 
@jalf Thread safety overhead is the reason he's not using shared_ptr, I think.
 
1:52 PM
ah ok
 
sbi
@jalf That's a complexity which I don't need to worry about right now.
 
user1357851
what's with this:
 
user1357851
~ref_counted() {if(!(*m_ref_count)--) delete m_ref_count; }
 
Nothing.
Use ctor list in copy ctor, man.
 
@sbi Your destructor deals with null ref_counted, but the other functions don't. Also, no assignment operators. Finally, you seem to keep a ref count... but not an actual owned object?
 
1:53 PM
@sbi btw, what this code actually does?
 
seems odd.
 
-3
Q: Fibonacii's algorithm in C++ - recursively

Maciej JanuszewskiI have a problem with my code. There is a Fibonacci's function which I hope you know what does. And there two files: In0201.txt and Out0201.txt. As well, the programme should get the value from file "In0201.txt" and write the results to Out0201.txt. Some value is being written but instead writin...

 
There is an assignment operator.
 
user1357851
auto pointer
 
oh, I didn't spot it because void return
 
1:53 PM
Also I presume boring functions were left out.
 
user1357851
ref counting
 
user1357851
am I right
 
OP writes one number to file and asks why only one number is written to file.
Rofl.
 
@sbi shouldn't ref count start at 1?
 
is it intentional that operator= returns void? Seems kind of unusual
 
sbi
1:54 PM
@CatPlusPlus It's an edit artifact that this is not currently used.
 
Oh. Seems ok.
 
sbi
@DeadMG No, the dtor doesn't. Look again.
 
Some people don't like assignment to be an expression.
 
sbi
@Abyx It's a ref-counting base class, to be used for whenever you need to ref-count something.
 
Returning void kinda inhibits that.
 
1:54 PM
@DeadMG I guess this is a mix-in.
 
@sbi Good shout.
 
user1357851
if(!(*m_ref_count)--)
 
@sbi I'm still kinda confused as to the use case- you don't seem to actually own anything with your ref count.
 
user1357851
destructor looks fishy
 
FIX THE CHAT DAMMIT
2
 
sbi
1:58 PM
@R.MartinhoFernandes Why? Isn't 0 just as well? Saves an increment/decrement pair.
@jalf It's not that anybody will ever manually assign such objects. Now that I say this, it occurs to me that I should make all the ctors and dtors private. Returning void allows to omit the return *this, making the code shorter. /cc @Cat
@DeadMG I am deriving from it.
 
@Telkitty If the ref count is zero, it deletes (and decrements too, but who cares). Otherwise it just decrements.
@sbi Yeah, I got that. ("saves")
 
sbi
Thx.
 
@sbi yeah, I've pondered doing the same before (mainly because I don't really see a good use case for the usual return *this convention.
 
@sbi Still, that will require writing a dtor by hand and checking is_last_referrer, no?
 
sbi
@jalf I have written this line just a few hours ago: return m_nvram_buffer_occupation = m_nvram_buffer_position - m_nvram_buffer_start. Now, those are built-ins, so the return *this comes for free. But should I ever change them to UDT iterators, those better implement this.
 
2:00 PM
ah.. I got it... it just counts copies of that pointer to reference counter
 
sbi
@R.MartinhoFernandes Right. That's why that function is in there.
 
You could grab this with a static_cast to Owner and have a protocol for deleting the whole thing without any more boilerplate.
Assuming CRTP here.
 
sbi
@R.MartinhoFernandes Oh! Damn, I didn't think of that! That would, however, require derived classes to implement a cleanup() function. But then, this would be better than now, when they have to manually do it in their dtor.
 
@sbi yeah, I tend to avoid doing that kind of stuff though, I think it hurts readability too much. But that's obviously subjective :)
 
if(!(*m_ref_count)--) { delete m_ref_count; static_cast<Owner>(this)->release(); }
 
sbi
2:03 PM
@R.MartinhoFernandes Yup. Thanks, that's neat.
 
@sbi Advantanges include a compiler error if you forget the cleanup, and no need to remember checking if it's the last.
 
sbi
@R.MartinhoFernandes Yeah, I got that. Really, it's neat. I'll do that as soon as the code actually works.
 
@R.MartinhoFernandes it happens in destructor, right?
 
sbi
Because this change still crashes the machine.
So nobody sees any real problems with this?
@Abyx Yep.
 
2:04 PM
@Abyx Oh.
 
when Owner was already destroyed...
 
Yeah... :S
 
sbi
Haha!
 
still... what the fuck is that reference counter for?
 
To build a reference counted buffer.
 
2:06 PM
@Abyx To ensure that nobody is referencing it obviously
 
sbi
@Abyx Since nobody sees a problem with it, let me show how I make use of it. Maybe the bug's in that part.
struct ref_counted_buffer : private ref_counted<ref_counted_buffer>
{
	char*        data;
	std::size_t  length;

	ref_counted_buffer()                       : data(), length() {}
	ref_counted_buffer(char* d, std::size_t l) : data(d), length(l) {}
	~ref_counted_buffer()                        {if(this->is_last_referrer()) delete[] data;}

	      char* begin()                          {return data;}
	      char* end  ()                          {return data+length;}
	const char* begin() const                    {return data;}
Anything wrong in that?
 
@Aardvark you mean it delegates to gravatar.com.. Mmmm. You may be on to something. Anyways, the pics don't get reloaded, since the page is already rendered. In Opera Shift-I will fix it, by reloading images. Might try that next time :)
 
my screen is being occupied with a wall of code
 
sbi
@TonyTheLion What are you looking at? (Not mine, as that is just a dozen lines.)
 
@sbi copy construction isn't explicitly done. how works that? Ah.
 
2:08 PM
@sbi I was referring to yours.
I was also trying to evoke a response from you.
it worked!
 
sbi
@sehe I want the data pointer to be shared by all copied instances.
 
@TonyTheLion I'm usually bitching about that because of my teeny 768 lines on the laptop, but now I have a big screen :P
 
Ah. The base class contains the ownership magic, right?
 
sbi
@sehe Yep.
 
@R.MartinhoFernandes my screen here isn't too large, so it fills about a third of it
 
2:09 PM
@sbi I'll just note that the copy ctor generation in this case (because there's a dtor), is deprecated in C++11.
 
@sbi Wokay, not much to review here then. It all depends on what it gets constructed with.
 
Just FYI, since I know you're on C++03.
 
something I didn't understand about the ape's first snippet is why he used a unsigned long* instead of just an unsigned long?
 
sbi
@R.MartinhoFernandes Wow! Is it? Mhmm. So should this ever get ported to C++11, I'd have to write them out? No, wait, there's that default magic, right?
 
@R.MartinhoFernandes Is there a diagnostic for that?
 
2:10 PM
@TonyTheLion Because it needs to be one refcount for all copies, not for each.
 
@R.MartinhoFernandes ah, so it's created once...
 
@sbi Yes, you could just T(const T&) = default; them.
@sehe Never ran into it, but I never tried anyway.
It's basically a tiny step towards making the rule of three come easier.
 
@sbi I'd change the base dtor to call private destroy() or something, instead of checking for last ref in every child.
 
sbi
@sehe So nothing wrong with that either? Damn. I was so hoping you guys would find an obvious error in this. Because now I have to go and hunt it in the code using it, which is highly concurrent, running on a small device across the room, and allows debugging only per TCP.
 
@CatPlusPlus UB. When the base dtor runs, the derived members are gone.
 
2:12 PM
Why.
 
sbi
8 mins ago, by Abyx
when Owner was already destroyed...
 
Base dtor runs after derived dtor.
 
Well, then all of this sucks.
 
How surprising.
 
sbi
I could make it a member, though, and pass it a std::(tr1::)function. But that seems a bit over the top, IYAM.
 
2:14 PM
Why not make data a refcounted ptr, so you don't have to write this boilerplate.
 
sbi
@CatPlusPlus Actually, that's exactly what ref_counted_buffer is supposed to be. :)
 
@R.MartinhoFernandes Then put the members in the base.
 
sbi
It replaces an earlier data pointer.
 
@sbi ref count all the ref counters!
 
Well, if you've got refptr primitive, then you don't need refcounted buffer primitive.
This all is just std::shared_ptr<char>
 
sbi
2:16 PM
@CatPlusPlus I do need such ref-counted buffers in several places. That's why I wrote that class.
 
> AFAIK, IBM is using a variant of EBCDIC on mainframes (that's why trigraph weren't removed and STC_MB_MIGHT_NEQ_WC is there to allow them using EBCDIC based narrow encoding and Unicode wide encoding)
 
ref_counted_buffer is just adapter over that
 
user1357851
this room is full of animal ... avatars :x
 
@CatPlusPlus But without the thread-safety.
 
2:16 PM
Haha, puppy, someone pulled the EBCDIC card on you.
 
@sbi not even a serial cable?
 
srsly?
 
Anyone using EBCDIC deserves to suffer.
 
they're updating their compiler to a new version of the Standard for an EBCDIC based machine.
 
struct ref_counter_buffer { std::shared_ptr<char> data; ref_counted_buffer() : data(new char[whatever]) {} /* the rest of the adapter interface */ }
 
sbi
2:18 PM
@sehe I think I could attach one. But then I'd have a cable lying across the walkway. WiFi is better.
 
Rule of zero.
And stuff.
 
and the corresponding smells
E.g. I can tell when the puppy enters by his colomb
@sbi Evidently. <grin/>
 
@CatPlusPlus Would invoke UB, since the shared_ptr calls delete on buffer.
 
Whatever.
Details.
 
@sbi Just in case the networking subsystem interferes or is otherwise malfunctioning :)
 
2:19 PM
If you really don't want thread safety, then I'd make ref_counted a primitive and use it instead of shared_ptr here and done. No CRTPin'.
 
@DeadMG you're screwed.
 
sbi
@CatPlusPlus shared_ptr needs locks around the shared count. I have seen this trash the performance of a desktop app.
 
See above.
 
sbi
@sehe It all works very well until I start my module. Then it goes down the drain immediately, before even any breakpoint hits.
 
Although you can use Boost's shared_ptr and disable thread safety for the same effect probably.
 
2:20 PM
@CatPlusPlus no boost, iirc
 
Y'all crazy
 
sbi
@CatPlusPlus Sigh. I have explained all of this yesterday. Incorporating (parts of) boost is still on the to do list. Further down, though.
 
@sbi can you eliminate whether your refcounted buffers is a (root) cause at all? My gut says, it might be unrelated
 
> So basically, there's absolutely no way, ever, to alter std::exception to make it Unicode-aware without destroying the universe, and if I wanted to have a Unicode-aware exception then I'd have to duplicate the hierarchy.
lol
 
@sbi Slightly related, I once posted a counted_ptr I did for a project that had to build on an older XlC++ compiler: stackoverflow.com/a/6594134/85371
 
user1357851
2:22 PM
@CatPlusPlus disable thread safety on shared_ptr in an multithread environment - you got your crash condition just right buddy
 
@sbi There might be some ideas in there. It does have a separate struct for the refcount. I don't specificly remember why it did that, but it may be relevant.
 
sbi
@sehe The crashes started to happen when I incorporated that change. I have already eliminated quite a few problems (forgot to remove a manual delete from the code :-x), but it still hasn't stopped crashing. Now they only appear when buffers are actually deleted, so I supposed I somehow fucked up the implementation of that. But it seems it must be in the other code.
 
@Telkitty For this I can only say:
 
sbi
@sehe That's all nice and well, but why should I replace my implementation with yours, if nobody seems to find an error in mine?
 
user1357851
I never understand why people write code like this:
 
user1357851
2:25 PM
if(!(*m_ref_count)--)
 
@sbi crazy idea: comment out all deletes - leak fest, yes, but see whether it crashes later
@sbi Did I say that would be an idea? I explained precisely why I'm posting it:
3 mins ago, by sehe
@sbi There might be some ideas in there. It does have a separate struct for the refcount. I don't specificly remember why it did that, but it may be relevant.
In other words: you can fuel your thoughts by looking at another simplist counted ptr implementation
 
sbi
@sehe I only need a certain number of buffers under certain conditions, and I keep a number of buffers around for reuse. If I make the latter number big enough, no buffer will be deleted. Then, nothing crashes. So I already know it's only when I delete buffers.
 
@Telkitty What do you propose?
 
user1357851
the simple and clear way
 
@sbi Ok, sounds right
@Telkitty Ah. That way.
 
sbi
2:28 PM
@Telkitty You mean the parentheses are superfluous? I wasn't sure, so I'd rather put them in.
 
They are.
@Telkitty That does not do the same.
If you're going to do better, at least don't lose functionality.
 
sbi
Oh.
Oh!
OH!
 
Xeo
if(--*ref_count == 0)
 
Xeo
2:29 PM
No?
 
Xeo
Oh, I see. he decrements after comparision
 
@Xeo Check is_last_referer.
 
sbi
@R.MartinhoFernandes I think I know what might be the (a) problem. And it's silly. Very silly.
 
user1357851
2:30 PM
if((*m_ref_count) != 0)
(*m_ref_count)--;
 
You're not really improving anything.
 
user1357851
else
 
user1357851
...
 
sbi
I have now been able to tweak the conditions so that I get a few lines of usable log messages before the device is wrecked, and I get this:
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
deleting buffer @1bc9c00
 
@Telkitty Ok. I'd agree with if(*m_ref_count) (*m_ref_count)--; else in this case
 
2:31 PM
Erm.
TBH, I find the "test-and-decrement" idiom pretty expressive.
 
sbi
Haha, silly me. I use this for debug output:
 
@sbi it might be deleting the refcount everytime instead of the buffer. I missed the 'first snippet' anyway
 
sbi
template<typename InpIt>
void log_events(const char* task, InpIt begin, InpIt end)
{
	while(begin != end)
		log_Info2("%s @%x", task, begin->data);
}
 
Strange - all those buffer addresses look the same to me.
 
@sbi Where's the increment.
 
2:32 PM
@MartinJames lol
@sbi infinite loopiness
 
sbi
@R.MartinhoFernandes Exactly. That's an endless loop. And endlessly running is a sure recipe for disaster on this device.
 
But no burn smell yet?
 
Y U NOT for LOOPS?
 
sbi
@sehe No, it shuts down before that.
 
@R.MartinhoFernandes Because: same difference
 
Xeo
2:33 PM
@R.MartinhoFernandes Sorry, just came back from showering
 
@sehe How so?
 
Xeo
Anyways, the ref-count mechanism seems bogus.
 
@sbi Oh. That makes it harder to recognize. Is there some kind of 'click' you could develop an ear for? Some kind of thermistor-triggering give-away?
 
Oh, that's easy - the fan revs up every time I get loopy threads.
 
@R.MartinhoFernandes If you can write a bug in a line of code, you can do so in another line of code. The chances might be slightly slimmer. I usually opt out of for if the loop variable isn't declared/initialized as part of the loop.
 
sbi
2:35 PM
@sehe There's the three LEDs labeled Run, Init, and Err. When they are yellow, its not a good sign, and I can see them turning read from across the room. That's when I get up to pull the plug and put it back in.
 
@MartinJames On your device. I use the same clues. Is also my kind of virus scanner :) (TBF I have a tiny CPU graph running atop the screen to be more nuanced)
 
@sehe It's a lot harder to miss an increment in a for loop.
 
@sbi Invest in home automation X11 gear :) Will save you some miles
 
Definitely not just slightly.
 
@R.MartinhoFernandes True.
 
user1357851
2:37 PM
I thought begin is incremented outside the function
 
@R.MartinhoFernandes Depends. A while loop without braces or ++ in the condition sticks out to me too. It arguably depends more on the coding patterns and code patterns than on the language construct, IYAM
 
user1357851
like printing one line at a time
 
user1357851
like live debug log
 
I also have the Vista 'CPU/memory' meters on the sidebar, but it's usually the CPU fan that gives the game away first, unless I'm listening to music on headphones.
 
@Telkitty Like... how? Anyways, given sufficiently funky iterator implementations, that might in fact be valid code.
 
2:39 PM
@sehe Personally I reserve the use whiles when I want the invariant !condition. If I want to cross ranges, I use for (range-based if possible) or no loops at all.
 
sbi
Well, it did live longer this time.
 
@MartinJames Well that's fine for big fuck ups. But the malware/spyware/runaway flash-enabled browser tab style stuff, untimely indexing background job etc. is more subtle and doesn't trigger any fan noise with me
 
@sehe funky as in... not conforming to iterator requirements?
 
@R.MartinhoFernandes :)
@R.MartinhoFernandes does the standard require deterministic results for operator==?
 
@sehe What do you mean deterministic?
 
2:41 PM
I suppose, because it requires commutativity, IIRC
 
It requires end iterators to compare equal only to end iterators.
 
if (it1==it2)
    assert(it1==it2); // never fails
^ deterministic
 
user1357851
@sehe like what FILE does ... while(!EOF) ... can't remember the syntax
 
@R.MartinhoFernandes so? begin could start being an end iterator of it's own concern. Unless it was required to be deterministic
 
user1357851
@sehe unless multithreaded
 
2:42 PM
@Telkitty ouch. dat API/code style :)
 
@Telkitty Even multithreaded. That changes nothing.
There are no synchronization primitives in there.
 
user1357851
@R.MartinhoFernandes it1 or it2 could change after tested for equal condition
 
user1357851
thus assertion failure?
 
user1357851
not likely
 
Nothing can change out of the blue without synchronization.
I guess you could write an operator== that did synchronization... But that would be silly.
It's either synchronization, or no change, or undefined behaviour.
 
2:47 PM
I'm a slow and lazy slob
3
 
sbi
@R.MartinhoFernandes On this device changes done by one task seem to be visible in other tasks. At least in a non-optimized application.
 
oh yes, but I'm a Lion. That's totally justified.
 
@sbi That does not use C++11. Also UB is UB.
@sehe I think it is. I can get proper quotes when I get back home if you want.
 
sbi
@R.MartinhoFernandes Yeah, so? Here, things do change out of the blue — without synchronization.
 
Otherwise you can't write anything iterator safely at all.
@sbi Because it's UB!
 
sbi
2:50 PM
@R.MartinhoFernandes That would either be late tonight or tomorrow evening. Remember?
 
@sbi Oh, right.
 
sbi
@R.MartinhoFernandes So? Your statement is wrong nevertheless.
 
@sbi It is right in the right context :P
(The context being the behaviour defined by the standard, which was exactly what @sehe and I were discussing)
 

« first day (754 days earlier)      last day (4187 days later) »