« first day (887 days earlier)      last day (4069 days later) » 

9:00 AM
@bamboon doubt it. I don't think a lot of traffic goes through those links.
 
I don't think anyone even reads them
 
@Mysticial not these days, but once you see a shiny 135 there, it's a must click.
 
@bamboon You have a point there...
 
@thecoshman :|
 
-6
Q: Is there a 'chucknorris.h' header?

exploringnetWhy do we have to include n number of header files before we can compile a c++ code? Many a time missing just one , creates large number of errors ,frustrating the user and the will to create something new. Is there any chucknorris.h Header file :D . Including which includes all the required hea...

lol
 
9:02 AM
@FredOverflow That was totally my fault. lol :P
 
@Mysticial How come?
 
@TonyTheLion :|
 
@FredOverflow It had a boring title at first. Then I left that comment and the OP took the suggestion.
End result: tons of downvotes...
 
@Mysticial hahaha
@thecoshman What are you doing today?
 
@TonyTheLion ergh... dodging work if I can...
in practice, chasing up on stuff
again
 
9:08 AM
it's just ahead :P
 
@FredOverflow If you include "chucknorris.h" header in your program, when true should be false, it gets a roundhouse kick in the face and makes it so
 
@TonyTheLion lol
 
There's a sign at a T intersection near where I grew up which read Clinton (arrow pointing to the left) Providence (arrow pointing to the right)
It was funnier when Clinton was in office, though I suppose it sitll applies :P
 
hahah
 
9:10 AM
@TonyTheLion woah... some one has effort
¬_¬ fuck you chrome
 
:effort:
 
Ahoy
quick question : why would someone make a destructor protected ? (non-virtual)
 
If the destructor is non-virtual, then you shouldn't destroy via deleting a pointer to base.
I.e. it makes destruction not part of the base interface. Only derived classes can be destroyed.
 
@ereOn Prevent allocation on the stack?
 
@FredOverflow wouldn't a protected constructor already achieve that ?
 
9:14 AM
@FredOverflow ::new (&storage) base works just fine.
 
@LucDanton But practically no C++ programmer knows that syntax ;)
@ereOn You already said protected, why do you mention it again?
 
@FredOverflow: I first talked about a protected destructor. Am I missing something ?
 
@ereOn Yes, me just waking up :) Sorry.
So are both protected?
 
Yep, seems so.
I don't quite get why.
 
Man the last episode of Grey's Anatomy that I watched last night was sad.
 
9:17 AM
protected destructor... sounds scary
 
@ereOn Can we see the whole code?
 
@TonyTheLion never watched it
 
Code that is written against the base interface won't create or destroy new instances.
 
protect the destruction
 
I always thought it had to be public
 
9:17 AM
@Neil what?
 
So only the class can destroy itself? Is that why?
 
No.
 
@thecoshman Its a good series actually.
 
That is not why.
 
@FredOverflow I just joined the company. I doubt they would be happy if I leaked code on my fourth day :(
 
9:18 AM
it's used for some fuck.
 
perhaps some sort of ugly manager class...
 
@ereOn You could always rename identifiers ;-)
 
Code written against the derived classes may, if their public interfaces is set so, create and destroy new values of such.
 
All I can tell is that its an object derived from QDialog
 
@ereOn depends what exactly you 'leake'
 
9:18 AM
which was given a protected destructor
and a protected constructor
 
yea, QT uses hacks fucks likes this
 
QT doesn't want you to put stuff on the stack, right? Then my initial assumption was probably correct.
 
Well it's not from Qt source code: it's "our" code but it usess Qt types
 
"Uses" as in "uses" or "inherits from"?
 
in this case: inherits
I mean if the constructor is already protected
stack initialization is already prevented right ?
why the need for the destructor ?
 
9:20 AM
Won't prevent delete p.
 
Why don't you ask your colleagues?
 
sounds like typical corporate attitude "oh, this library does exactly what we want... but if we just shoe horn this crap on it... we can make it more 'us'"
 
Or are you afraid that asking questions will get you fired? ;)
 
Someone paste a link to this.
 
@FredOverflow: Well, I don't want to look like I ask dumb questions.
Even though I'm not sure it is really that dumb.
 
9:21 AM
I don't think that's a dumb question at all.
A dumb question would be "What is protected?" or "What is that funny ~ symbol?"
 
@FredOverflow don't act like it's so absurd, that seems to be the attitude where I work
 
@thecoshman We are not his colleagues. We are not work.
 
you may be right indeed. Gonna ask.
 
@ereOn wait
9
Q: Protected vs Private Destructor

doronIs there any difference between a protected and a private destructor in C++? If a base classes destructor is private, I imagine that it is still called when deleting the derived class object.

> Use a protected destructor to prevent the destruction of a derived object via a base-class pointer. It limits access to the destuctor to derived classes. And it prevents automatic (stack) objects of class bas
 
so some sort of ugly manager... wait, that sounds familiar
 
9:27 AM
So it seems this was indeed done to force the developer to instantiate the class trough a static factory method
so that the instance gets registered somewhere
so that the program doesn't leak
is it me or does that seem a bit crappy complex ?
 
@ereOn yeah, crappy
C++ solved this problem a long time ago, scope
 
Yep.
Even in the Qt world, there must be some way of doing this better
 
@ereOn The destructor has nothing to do with that.
 
@ereOn That's pretty much the Qt way IIRC.
 
@ereOn oh that really seems like "quality C++" //cc @CatPlusPlus
 
9:29 AM
well, perhaps if it was some sort of 'connections to precious resource' that had to be limited... then maybe such a system could be used. but it still seems like a bad way of doing it
 
Or maybe the object registers itself inside the constructor, cannot remember.
Either way, you don't call delete in Qt, even though you call new.
 
@BartekBanachewicz oooh, rousing the beast huh?
 
@FredOverflow That would be reason to control access to the destructor.
 
right
 
@thecoshman just poking him a bit
 
9:32 AM
You mean doing so, only the base class (and the class itself) can call delete on its child ?
 
@FredOverflow in Qt, you always should pass a parent.
 
so... apart from a painful to use GUI lib, features that are now standard, features that Boost offers, features that you probably should use a dedicated library for... what does Qt offer?
 
@thecoshman it offers all that in one.
good docs
 
@bamboon so that's it, it wraps some shit together, and that makes it worth using?
 
way better than boost
 
9:35 AM
good docs for shitty library
 
@thecoshman yup, that's it.
 
seems legit.
I am not using QArray ever.
lemme
> 10. If your library does not play nice with the standard library, I will hate you.
 
@thecoshman Remember, Qt was developed before the first C++ standard. IIRC
 
@bamboon well, excuse me whilst I continue to be cynical
@FredOverflow first release, 92?
 
9:37 AM
@FredOverflow which means they had a lot of time to update
0
Q: Poco C++ Array of custom objects

David KarlssonHow do i store an object of type myObject in a C++ array for access later. I've tried but get complains about constructors. I am using the Poco framework so using Array::Ptr or Poco::Array would probably be ideal: Array::Ptr myArray; myArray.add(instanceOfMyObject); .... MyObject obj= myArray-&g...

Poco::Array
 
@thecoshman no problem, I am not a fan of Qt either but I see the good points and why it's used that much. It's just a giant eco-system, which works pretty well if you stay in it.
 
make (e=5): Access is denied. in dev c++. what should I do to resolve this? Even I am not able to compile any programs. using windows seven.
 
that's ironic, "po co?" in polish meanst "for what?"
 
help me please...
 
Honestly, I prefer Java+Swing to C+++Qt :)
 
9:39 AM
@sree how about you read the rules?
@FredOverflow +1 on that
though SwingWorker is fucking terrible
 
background tasks?
 
@sree Ask one of the real C++ rooms.
 
what to do ?
 
It's unintuitive
 
9:39 AM
I just new up a thread :D
 

<!Real> C++ Room

ISO<14882:2011> I have nothing to say.
 
ok
tell me one
 
@sree ProTip(c): Read the error. The system denied you the access to something.
 
@bamboon just really not a fan of monolithic libraries. I would much rather be able to take my code base and say 'damn, I really need to add feature X, I can swap lib A for lib B, and pow!'
 
damn we have no regular to bin shit.
 
9:40 AM
Presented a quiz question for my colleages. Why does it output the same twice? :D
 
process_begin: CreateProcess(C:\Users\sree\AppData\Local\Temp\make5060-1.bat, C:\Users\sree\AppData\Local\Temp\make5060-1.bat, ...) failed.
make (e=5): Access is denied.

mingw32-make.exe: *** [main.o] Error 5
 
#pragma?
@sree GTFO
Oh, guys, I wanted to ask actually
 
wts GTFO ??
 
@sree @StackedCrooked, work boy
 
@sree Have you tried putting that error message into Google? sourceforge.net/p/dev-cpp/discussion/48211/thread/f0ab7e7b
 
9:40 AM
Is it okay to #include inside the class?
 
is that resolve the issue ?
 
@sree it certainly resolves the issue of you being here.
2
 
yup but no use
 
@thecoshman I am with you, but as of today that is not possible.
 
@sree Ask it in the other room.
 
9:41 AM
@BartekBanachewicz it could be used... but my lord that is an ugly way of doing anything
 
Wow, I’ve rarely seen so much wrong information in an ostensibly well-researched post:
 
@sree What makes you think we are Dev C++ experts? Just ask on stack overflow.
 
-1
A: What is the size of void?

krissMost C++ compilers choosed to raise a compile error when trying to get sizeof(void). C chose instead to define sizeof(void) as 1. It may look strange, but has a rationale. When you do pointer arithmetic adding or removing one unit means adding or removing the object pointed to size. Thus defin...

 
@thecoshman wait
 
@bamboon ¬_¬ I have plans...
 
9:41 AM
I want to include only enums
The point is a) they are lengthty
b) in theory the possible values can change with OpenGL version
 
I presume you mean you want sometihng like class foo{ #include "lazy.h" }
 
`class Texture { #include<texturetypes.h> };`
`enum Type { ...};`
 
What are the contents of lazy.h?
 
`enum Type { ...};`
`enum Format {... };`
etc.
 
@FredOverflow something like ^
but no, I would not do it that way
 
9:43 AM
So it can be accessed by Texture::Type::foo
Also, they are enum classes
 
Seems fine to me at first glance.
 
@thecoshman It's not really painful to use
Also an event reactor
 
@FredOverflow, thank you for your input.
 
@thecoshman any real con of this approach?
 
I would have just a proper header for a proper data type, that you can still change, and include it in a normal way...
#include "enums.h"
class foo { /* thing defined in enums.h */ bar; }
 
9:44 AM
umm
1 min ago, by Bartek Banachewicz
So it can be accessed by Texture::Type::foo
 
@BartekBanachewicz just sounds ugly as all heck to have and include in the middle of a class like that
 
@thecoshman it's unusual. But I don't really see the problem with it.
 
Why are you including things in the middle of the class again
 
refactoring the enum into a header is fine though
 
@CatPlusPlus start here
 
9:45 AM
I would at least write a comment saying I know nested includes are unusual, but trust me on this one :) :)
 
@BartekBanachewicz 'ugly as all heck'
 
@BartekBanachewicz Meh, we played with RLOs in the Lounge a long time ago.
 
@FredOverflow that fact that you would write such a comment makes me doubt doing it
 
@BartekBanachewicz Yeah, why
Why do you need to include things inside a class for that
 
@CatPlusPlus there are two points I made just under :/
 
9:46 AM
@thecoshman I feel honored.
 
Just move entire enum
 
the class will be big
and no easy conditional compilation for different versions
 
@CatPlusPlus Wait, are you talking about #including stuff in the middle of classes?
 
So? You think splitting it into several files increases readability?
 
@R.MartinhoFernandes I am talking about it.
@CatPlusPlus yes.
 
9:47 AM
No it doesn't
 
so what about b)
 
Also if your class is big, then it's a sign that it's bad
 
no, just the enums are lenghty
are you even listening for fucks sake?
 
@CatPlusPlus Unless the class is called Penis.
 
1 min ago, by Cat Plus Plus
Just move entire enum
I really don't see where you need to include things inside a class for this
 
6 mins ago, by Bartek Banachewicz
@thecoshman any real con of this approach?
 
@FredOverflow Better allocate that on the heap then.
 
Oh that
So yeah don't use inner types problem solved
 
@CatPlusPlus okey, that's what I am doing now. I was just curious.
I can't see any real problem with that
 
9:52 AM
@BartekBanachewicz Yes, it's brittle as heck, and it duplicates code, and the code has terrible locality.
 
It's confusing
Also creates a header that can be only included in a very specific place
 
Why don't you just #ifdef the Tex_3D (or not care)?
@BartekBanachewicz One more reason to not duplicate them for a couple of minor differences.
 
Well, I'll make them non-nested then
 
@FredOverflow read that more as 'the fact one thinks of doing X should make one question doing Y in the first place'
 
@R.MartinhoFernandes they have to be correct in order for this to make sense at all. Remember it's a library code
 
9:55 AM
FTR, I have various files with #include in the middle of scopes in ogonek. :P
@BartekBanachewicz Not sure what you mean.
 
I doubt that shitload of #ifdefs will be clearer than just repeating some values
 
@BartekBanachewicz I see no reason to include those there. move the inlcude to the start of the file like a normal person, and put those enums in a proper name space
 
@BartekBanachewicz It is definitely clearer, because locality.
 
@R.MartinhoFernandes the point is to limit the possibility of fuckup introduced by shitty C api
 
@R.MartinhoFernandes link
 
9:57 AM
2 mins ago, by Bartek Banachewicz
Well, I'll make them non-nested then
 
Instead of enums make several texture types
 
Texture is templated already
type was a bad example
 
Well I'd do that anyway
 
but there are more, like TextureFormat (RGB/RGBA etc)
 
@thecoshman It's for dropping huge chunks of automatically generated test data. (e.g. github.com/rmartinho/ogonek/blob/master/test/…)
 
9:58 AM
or TextureDataType (GL_FLOAT, GL_BYTE etc)
 
@R.MartinhoFernandes oooh... still sounds dodgy to me... but given the use case, I think this ok. I would still have a comment saying the include is an automagically generated file
 
I honestly don't see a problem with not caring and keeping all the enumerators in.
 
@R.MartinhoFernandes you introduce the possibility of putting unsupported enum
 
@thecoshman It's this file that is included, btw: github.com/rmartinho/ogonek/blob/master/test/…
@BartekBanachewicz Your code will have to check for it anyway.
 
This is the thing that can be checked at compile time
 
9:59 AM
@BartekBanachewicz It cannot.
 
@R.MartinhoFernandes wat.
 
Both of your example enums have 2^32 possible values.
 

« first day (887 days earlier)      last day (4069 days later) »