Assume a class A is a normal class with a single cpp and a single h file Class A depends on class B and some
auto_ptrimpl())
pain.
ok man, thank you, i think you only missing the -o helloworld in the end
yeah
the best way to do this maybe is using a Makefile?
pkakkar_, no I am not interessted sorry, I am too busy
mad_lord, sure
okay!
pkakkar_, I might help on a concrete problem
pkakkar_, but I have no time to work on another project
evilissimo, Can i have your email addr..
pkakkar_, if I am available for questions I will be here
but
so, this is the last question, i promess, do you know how can I insert the `pkg-config gtkmm-2.4 –cflags` attribute in the Makefile ?
there you go, pkakkar_
mad_lord, let me even do one
evilissimo,Thanks
how to read or write classes to files??
The term is called serialization.
mad_lord, http://snip-a-lot.de/gtkmm_template.tar.bz2
can anyone thinknof a neater way to write this? http://rafb.net/p/vvMSAW14.html
One way is to have that code in a macro like #define MOM_LOOK_THIS_IS_NEAT
i really dont like macros :/
theres no other way?
wow! thank you som much man
np yw
Dunno, it's too hot to think of neat code
Unless it's lisp
where are you?
Finland
it sure as shit aint hot here (UK)
what i really want is a way to clear a function object
when does template argument deduction doesnt work for functions? I know a case where the function argument type depends on the template argument (being a nested type of a template class type that depends on the template argument)
here are now arround 35 degrees officially tho on the street in the city I bet there are more than 45
d1zzy, the standard tells you, I think there was a clear clause that says when inferring doesn't work
See above regarding heat
And code
indeed
ok I'll look it up, didn't knew exactly where in the standard to look or what to search for
The standard term for it is "inferring", for easier grepping
ah found Template argument deduction, page 285
Oh, it isn't?
orly?
how long have you been doing ISO C++?
Since 1998 or so
heh
Adrinael never did c++, he's a lisp guy, so he's infinitely intelligent, which explains why he's active in 40 channels simultaneously
Hey, wait
Alternatively, he doesn't have a life.
Activity in window 59
recusion does that.
But who does?
does a job count as life ?
No
damn.
Does not having a job count as a life?
No!
There goes my options.
you get a life when you stop asking these questions on IRC
Will I stop asking questions?
I just had a life!
!8ball Will blank ever stop asking questions?
Maybe…
We have hope!
job or no job, just skeedaddle along, whistling a happy tune. That is life.
I think that's being canadian, not having a life
I can't whistle!
But if you're not Canadian it'll be a life.
So much Canada
/msg jkp no idea if it works like this but you might try: http://rafb.net/p/bqc0o917.html if you like it
blame Canada
haha
What a dirty private message!
:p
ta!
helping people priately, shame on you
evil villainHAHAHAHAHA/
Everytime you use boost, god masturbates.
nifty
poor god
must be nackered
that would be nice, but i think for it to be useful or worthewhile the ConstructDelegate template needs to be more geeneral
literally :p
thanks for the idea tho
jkp http://rafb.net/p/c2bOcE23.html
this is what i was thinking
That is starting to look more and more like bind.
you could have variants for the number of parameters too
Zao,
yes, but the problem with bind is that it doesnt detect or allow NULL
I'd say it's a flaw if you bind an member function to a null pointer.
can anyone tell me how to read and write classes to files??
!fs seria
serialization is http://www.parashift.com/c++-faq-lite/serialization.html | http://www.boost.org/libs/serialization/doc/index.html
abhee, someone already responded
when you declare a functor it can be used in a boolean experessioon to tell if it is set
abhee, it's called serialization.
You've already gotten the magic keyword "serialization".
!give abhee serialization
serialization is http://www.parashift.com/c++-faq-lite/serialization.html | http://www.boost.org/libs/serialization/doc/index.html
i hd got disconnected
hehe
so what i want is a way to say, if i give you a null pointer, give me that initiali functor back
Hello!
lo
look at this code, coped from Thinking in c++ book :
http://rafb.net/p/H2bPhS21.html
f5() = X(1);
what does it mean?
rthriller, what does line 14 do.
it returns an X object
So you have an instance of X on the left hand side.
What does X(1) do?
but it is unusal (at least for a beginner) to use a function on the left
but then the object created is lost?
After line 29, yeah.
so that line is useless
and line 30 doesn't use the object created in line 29
Well, the whole code is useless.
Right, line 30 is a new instance of X.
Yes it is.
so it is not common to put the func at the left side?
no
ok, thank you. That was really confusing
anyway, referring to "static" keyword, isn't it a bad situation that the same keyword has 3 meanings?
apparently Bjarne doesn't think so
hi all
Haha. static is hardly unique in that regard
anyone know what is the best* version of tic++'s pdf ?
Probably the non-corrupt version.
Arafangion, lol
since i got 4/5 version of pdfs. each of them has some advantage
ok but I ask: 2 meaning is already a bad situation in C… but 3 meanings in C++ is even worse!!!!!!
Consider '&' and '*'.
In some way it simplifies the syntax once you know it - Human kanguages require far more context.
no, it would be bad if they were confusing somewhat
but they are not confusing
they are actually very easy to learn and share common semantics
there are common features to all "static" usage out there
they dont just pick up some random feature and say let's use static host for it lol
i see
you know, they could have used "static" instead of "virtual" for virtual inheritance too
yeah
Metabol, now that would be confusing
but d1zzy why c++ introduced "private " keyword if it's right what you are saying?
but d1zzy why c++ introduced "private " keyword if it's right what you are saying?
What's virtual inheritance?
because they found no other keyword that shared common semantics with what private jvm web hosting should have done
class D : public virtual A { };
that's the point. if I am to decide how to implement per class members, obviously I think that "static" is a good candidate
Arafangion, if you multiply derive from two classes, and those two classes derive from the same base class, the virtual keyword makes that original base class singular
that's because the other statics too exist as long as the program exist and so on
same thing with "auto" for C++0x used for type inference
I think it's a good choice
what should they used instead?
i see
"decltype" on the other hand, meh
maybe the should have eliminated static (in the meaning of visibility)… but in this way it wouldn't had compatible with C
sorry for the horrible sentence
let's reorder it:
I think there are really other language problems in C++ than overloading static/auto
those 2 are really non-issues
which ones are them? can you tell me one of them as an example?
current C++ misses proper way to do move semantics, misses proper way to do perfect forwarding, misses a delete expression with additional parameters (as you can call new with additional parameters)
yeah, if you don't like it, see it as an endearing excentric quirk
those I am more sad about
with Mojo & co move semantics can be implemented but it's cumbersome and has dirty syntax
perfect forwarding it's very nice to have it to have wrappers for new to make all your objects return auto_ptr and such (new_auto_ptrType(args))
having additional arguments to delete as you can to new allows for a symmetric and scalable way to play with various memory pools using new/delete expressions
but in the end none of those are showstoppers
being a C programmer for a long time I really can't complain about C++'s lack of functionality (that would be absurd heh)
id like a better way of implementing forwarding i have to say
i see
thnks
C++ has some ugly things from C too, array-pointer degradation, lame switch()
so far I consider it the perfect blend of low-level coding functionality with highlevel (even compile time metaprogramming) coding. and because my interests (and job) are arround system programming, C++ fits very nicely there
What's wrong with the switch? (Though it'd be neat if one could allow more complex types in switches)
yes, more complex types / full blown expressions, and no automatic drop-through between cases
Like in Common Lisp!
i know that this is off topic but do you know any good guide for low-level programming in C ?
I don't see why C++ couldn't have such features, except for the drop-through thing. (Which I personally like)
right now it just looks like syntactic sugar for an assembly jump table
Which is what it is.
yes!
But I don't lose sleep over it because switch() does not conform to the OO paradigm anyway
I disagree.
Though… In OO code, many people /do/ misuse it.
For example, in my code, I have: keyHit(key) { switch(key) { … }}
that was kind of a tongue in cheek remark about the OO paradigm there
Many of the design patterns in Fowler's book seem to be focused on how to abuse switch cases and how to therefore "improve" the code.
Analysis Patterns? Haven't read it
So many Fowler books
To be honest, I haven't read it either, but I'll bet that they abuse switches
I do lose some sleep over 1) the lack of, whatchmacall it, compiletime and/or runtime introspection, I don't know the term. For things like serialization, database binding, widget binding. But I don't know enough to see how it should work
2) the fact that C++ is hard to parse
(2) is quite true.
There are alternative syntaxes, though, afaik.
Does there even exist a "refactoring" tool which does something so simple as a safe project-wide renaming of a member variable? Is it even possible to write?
vs does that, iirc.
Borland Developer Studio
You'd need a miracle to catch macro appends and the like.
SlickEdit
yes
fwiw, 1) is what we try to solve with the moc tool in Qt
Or you could write a parser and Do It Right
ast, change, convert ast back to files pre-tu, work out what's changed — not trivial)
tu ?
!tu
A source file together with all included headers and source files, less any source lines skipped by preprocessor conditionals, is called a translation unit, or TU. TU's can be separately translated and then later linked to produce an executable program.
ah
FauxFaux, I think it needs to be coupled with the actual compiler one uses, then, barring preprocessor tricks, it's possible
Yeah. I know for a fact that VS' parser and compile hosting are different (yeah, bitch away), so their's wouldn't be foolproof.
bhughes, thanks, that is worth something, because, and you have probably heard this before, the principle of the moc can be intimidating
all the time, yes
I can think of some legitimate cases where you'd need to cope with simple preprocessor conditionals (state pointers being different on different platforms etc.)
i have to agree with you though, i would love to see meta information as part of the language
Do you know why switch-case only works with integers?
switch-case will work with any constant expression that can be evaluated at compile time
you probably mean runtime.
no, i meant compile time
no, compile hosting time
for the case blocks, that is
is this also in the standard or compiler-specific ?
is not allowed
kirkt, it's standard
the expression in switch() can be evaluated at runtime
Metabol can u refer me to how to find it there ?
is 'function polymorphism' used a lot?
kirkt, standard in my head is not, sorry
My theory is that because ints can be represented as 1 \/ 2 \/ 3 \/ … \/ 2^32, as an discriminated union of numbers, thus they can be used in switch-case.
ok found it
heh?
\/?
\/ == or.
gotcha
http://rafb.net/p/YFUiza63.html and I am still getting aborted by SIGPIPE :/
strange… which version of Qt?
!rq
it might be shunned by the religion of C++.
4
(be prepared, we may get chased off to #qt ;D)
:p
this is an issue with signal handling
are you using pipes in your code?
threads?
!rq
no sockets
i am merely a padawan amongst masters
!rq
What a helpful channel you guys are
I get SIGPIPE while trying to write to a disconnected socket I guess
yup
just want to ignore SIGPIPE
no threads?
qt opens a new thread?
http://www.opengroup.org/onlinepubs/000095399/toc.htm
if yes then the answer is yes
no, i'm asking if you are using threads
no I am not
k
http://www.opengroup.org/onlinepubs/009695399/functions/sigaction.html
that's a good place to learn about signal handling
i have to say though, if you're using Qt 4, why not use QtNetwork?
does that handle OS signals too?
Hey. I'll jump right into asking questions… Hope that's ok…
I'm trying to do a stacktrace on win32 (MSVC), but I'm having problems. I get the first frame right, but then StackWalk64 returns false on the next… This only happens in optimized mode (but with debug info), but MSVC's internal debugger can properly show the callstack.
Anyone happen to know a lot about StackWalk64?
it eliminates the need to deal with them, yes
ok thanks I will take a look
http://doc.trolltech.com/4.3/qtnetwork.html
int s0 = someString.find_last_of(someChar); ?
std