« first day (206 days earlier)      last day (4728 days later) » 

12:48 AM
hi all
 
Xeo
1:00 AM
Anyone still online and able to could provide a quick shoot down of this question via a closing vote: stackoverflow.com/questions/5943960/…
 
@Xeo done
But still 1 vote required.
 
 
2 hours later…
Xeo
2:55 AM
Oh boy....
0
Q: Not a recognized operator or type when #define new is added

StrangeCodeHi all, I'm trying to solve a part of my program, which has a #define new. Everything works well, until I try to create a class template that overrides the new operator, when I get the errors: C:\Define_New_problem\main.cpp:18: error: expected type-specifier before 'dPushMemManFileLine' C:\Defi...

 
Xeo
3:30 AM
Geez. Everytime I write a link in the chat or in a comment, I feel like I'm typing a lambda expression...
2
 
 
1 hour later…
Als
4:43 AM
@sbi: Good morning...Early morning eh
 
sbi
@Als Yep. It takes a while to bully all the kids out of house, so I have to get up early enough. (Now one of them is already on the way, one has breakfast, and the others are still sleeping, so I got a sec to breathe in between.
 
Als
@sbi: How many kids do you have?..just curious
 
sbi
@Als Many. That must be enough for the greater public. :)` (I've said before that I wouldn't say "many" if it were just three.)
 
Als
@sbi: No worries....I aint going to stalk you :P
 
sbi
I sent someone an SMS on Sat evening, and now he gets it once every hour. This morning he's got the 60th. We've both restarted our mobile phones, and he's contacted his provider, which, of course, denies any blame in this. I have now contacted mine, but I have little hope that they would take the blame. I dearly hope I won't get charged for this.
 
Als
4:53 AM
Don't you get free 'n' no of sms in your plan? I never seem to finish up my free quota included in my plan.
 
sbi
@Als I got a limited number of free minutes/SMS, but 60 is a deep hole into that mount.
 
Als
@sbi: Oh i get 12000 secs talk time and 50 sms free in my plan i think
@sbi: I need to work on Audio Video Sync for mpeg2 digital streams...interesting but complex!
 
sbi
@Als I think its 300mins for me (an SMS counting as a minute). This issue is now a fifth into that, and we haven't stopped it yet.
 
Als
@sbi: Oh its a good percentage of that quota....you should complain the service centre, even better tell them you are changing your service provider if you get billed for those.
off for a bit....meet on digital audio video sync!
 
5:56 AM
morning yall
 
@Tony hi
 
6:08 AM
hi
 
Xeo
6:18 AM
@sbi Some phones allow an option to keep sending SMS if the previous try didn't make it or they get no notification of it. Look if it's hidden somewhere in your SMS settings, a simple restart won't fix it.
 
Als
6:30 AM
@TonyTheTiger: Hola
@Xeo: Its unlikely that setting is on by default
 
Xeo
@Als Not so unlikely like I've seen some cases. Normally though you don't notice it, as your phone gets notified that the message sending was successful
 
Als
@Xeo: I know, but the receipt notification has to be turned on explicitly, it is not on by default etting
 
@Als ehlo
 
sbi
7:26 AM
@Xeo Thanks. I looked into this. There was a setting "message validity" (somewhat misleading, given the German translation "Sendeversuche"), which was set to maximum (with other valid settings being 1, 6, 24, 72hrs or 1 week). I set this to 24hrs. Let's see...
 
@sbi mobiles eh...
 
Als
@TonyTheTiger: I worked on mobile handset software development for a few years :)
 
@Als oh I see
 
Als
@TonyTheTiger: Stuck with consumer electronics now....
 
@Als :p
@Als what kind of consumer electronics?
 
Als
7:35 AM
@TonyTheTiger: Set Top Boxes! rendering..streaming..Q..remember...
 
@Als oh yea, sorry wasn't thinking
not quite awake yet
 
Als
@TonyTheTiger: Lucky you :) ....Im struggling to awake too..just I am at work though lol
 
@Als I'm at work too...
 
Als
@TonyTheTiger: Same Pinch! :P
lol
 
Als
7:39 AM
@TonyTheTiger: I am wrestling Audio Video Sync today :(
 
ugh
sounds complicated
where did you learn all this stuff? or are you learning as you go along?
 
Als
Yep for me too....Lack the domain knowledge..trying to learn along...
 
@Als oh ok
 
Als
@TonyTheTiger: Doing this i learned to be patient if my TV doesnt sync Audio & Video....lots goes back down there to sync them seamlessly
 
@Als I don't even want to begin to imagine what goes on
 
Als
7:44 AM
@TonyTheTiger: lol..I aint telling you...tis a secret ;)
 
@Als hahah ok
 
Als
@TonyTheTiger: I prefer rep whoring rather than talk of work ;)
2
 
@Als hahah
do you know anything about headphones?
I am trying to see if it should be Denon or Bose?
 
Als
Bose all the way!
Might consider Sony as well...
But Bose Rulz!
 
Xeo
Seriously, is SO becoming the "Google" for coder?
0
Q: New C++ Programing Language ?

I Phantasm II read some were that a new C++ language was being created...is this true?? if so does anyone no how the Dev goes? I believe it was meant to come out in 2010 but was delayed?

 
8:13 AM
It is bound to be.
 
morning
This is quite amazing directtovideo.wordpress.com/2011/05/03/numb-res SPH with 500'000 particles in real time
std::list<T>::iterator it = data.begin();
templatedSerialization.cpp:25: error: expected ‘;’ before ‘it’
what?
 
@Nils typename ?
 
it's a function template
template<class T>
void writeListBinary(std::list<T> data, std::string filename)
 
@Nils if T is a template argument then you need typename
 
ah the keyword
thx
almost forgot about it
 
8:24 AM
@Nils thanks for the link
 
Xeo
@LucDanton Heh, as soon as I see a xxx<T>::iterator I assume a typename is missing. :)
 
Als
8:37 AM
Any Linux experts who can help out with this one?
 
humm now it says template argument1 invalid, template argument2 invalid on the same line
 
Als
0
Q: Passing user data with timer_create

AlsI am using timer_create to create a timer in Linux. The callback prototype is: static void TimerHandlerCB(int sig, siginfo_t *extra, void *cruft) How can i pass user data so that i can receive the same in the callback called after timer expiry. Here's my sample code: int RegisterTimer(iDi...

 
Xeo
Heh.
With undefined behaviour we're fast: stackoverflow.com/questions/5947437/…
 
sbi
@Xeo Well, a good C++ programmer should write fast code without invoking Undefined Behavior.
 
8:47 AM
@sbi sounds premature
 
@sbi But I like undefined :) It gives it a nice twist :p lol
 
codepad.org/I1VUrezf haven't used templates for a while, what am I doing wrong?
 
@Nils I have troubles connecting to codepad.org, could you upload to e.g. ideone.com?
Nevermind it loaded
 
well it's slow
 
It should be: typename std::list<T>::iterator
in this case we're telling the compiler that iterator is the name of a type
 
8:53 AM
ah
 
We already know T is a type (as per the template argument list)
 
ah ok, now I start understanding the typename keyword
 
however std::list<T>::iterator could be a type or non-type and needs disambiguation
 
and is it template<class T> or template<typename T> ?
 
Either are valid
 
8:55 AM
is there one which makes more sense?
 
some advocate the use of 'typename' over 'class' when the template can be used not just for class types, as in std::vector
I personally use typename everytime because I don't care if it's a class or not
 
I thought the typename was to distinguish dependent names in this case, maybe I'm wrong
 
@Tony in the case of typename std::list<T>::iterator it is
 
@LucDanton oh ok, so I did understand it right that the dependent name is the T right? it's dependent on the templated argument
 
@Tony T is the argument; iterator is the name that depends on T
 
8:58 AM
@LucDanton oh I see...
 
sbi
@TonyTheTiger Well, typename originally was introduced to disambiguate dependent names. Since they had a new keyword anyway (C++ traditionally has had a cautious attitude towards introducing new keywords, because they tend to break old code), and since it would be a better fit than class for template parameters, it was proposed and accepted as an alternative.
 
@sbi Aha, I see
 
sbi
@TonyTheTiger You need to disambiguate with typename whenever and identifier's meaning could change with a template parameter. The classic is X<T>::Y: depending on T, Y could be the name of a type or member of X<T>, and, in theory, this might even change with different types for T, because X could be strangely specialized.
 
@Xeo I hope so. It's a better google for coders than google is
 
sbi
@Tony: Along the same lines, X<T>::Y<Z could be a comparison of X<T>::Y with Z or the beginning of X<T>::Y<Z>, which refers to an instance of Y, defined within X<T>, with Z as a template parameter. You need to inject a template if you mean the latter: X<T>::template Y<Z>.
 
9:12 AM
What are the implications when I have a function template whose return type is also templated..
 
When calling it, you may have to disambiguate and make the template parameters explicit, if the function arguments don't make it unambiguous: auto x = func<T>();
 
@Nils for that reason the return type usually is the first template parameter
 
auto is C++0x?
 
@Nils yes; in C++03 it's already a keyword though and is largely useless
 
ok
What's the way to iterate over two std::list of the same size? For example to compare the elements.
 
9:21 AM
Stupid but valid C++03 code will now be broken: auto int x = 3; is valid C++03, but not valid C++11.
 
@Nils std::equal_range comes to mind...
 
@Nils std::equal
 
I may have imagined my algorithm!
 
oh reading overload resolution rules
pfff complicated
and this is a "simplified", doesn't contain all version
 
@LucDanton There is a std::equal_range, but it does something else.
 
9:25 AM
@Martinho Thanks for the heads up
 
9:50 AM
how is this by-value?
// maximum of two C-strings (call-by-value)
inline char const* max (char const* a, char const* b)
{
return std::strcmp(a,b) < 0 ? b : a;
}
a and b are pointers to const, so I don't see a by-value passing here? but I'm probably missing something
 
You pass the vqlue of the pointer.
 
@AProgrammer so pointers itself are passed by value then?
 
Right.
 
but what they point to isn't passed by value though, right?
 
No. If you pass an index into an array, that isn't very different from passing a pointer and you'd never consider that as passing by reference.
2
 
9:53 AM
@AProgrammer omg, I thought that passing by ref was using a pointer in the args or using a reference, seems like I've been wrong
ugh
 
@Tony from a Java perspective: javadude.com/articles/passbyvalue.htm
 
so f(int* i) // pass by ref (ie pointer) is the same as f(int& i)
 
You can call it pass by pointer, it's common enough that people will understand
 
@Tony, it also somewhat depend on your POV. I'm searching a discussion on LTU on this subject where other POV were present.
 
It's one of those terminology problems (IMO); passing by reference is referentially transparent whereas passing by pointer is not, but still allows the same range of side-effects...
 
@AProgrammer ah, but essentially to me pass-by-value means the value of the variable is copied into the param, pass by ref means, you're only getting something referring to the actual value of the variable, and since refs and pointers refer to their actual values, this is pass by ref, but I could be entirely wrong too
@LucDanton meaning?
 
@Tony 'reference' can have a technical meaning where pass by reference is quite different from pass by pointer, but you are correct that c++ programs can use the two strategies to do the same things
 
Does anybody remember when was the last time that wsock32.lib import library was the right one to link to for Winsock?
 
@Tony, you can achieve the effect of pass by reference by passing a pointer and then dereference it. But the pointer is passed by value. At least if you take a "compiler implementer" POV. Language theoricians seem to have reused the terms with a related but subtly different meaning.
Then simple programmers are more concerned by the effect than the underlying implementation techniques...
 
@AProgrammer but I like the "compiler implementer" pov, cause it seems more technically correct
although it takes some getting used to thinking about it that way, after you considered it otherwise for so long
 
10:44 AM
@sbi: I had a burger, and an ice cream, and it was delicious and I was fine.
 
@DeadMG oh good :)
 
indeed
it was delicious
 
:p
so are you working for uni today?
 
@sbi And why did they introduce a new keyword? Why not class std::list<T>::iterator it? Or would that be gramatically ambiguous?
@TonyTheTiger Everything in C is passed by value :)
 
@FredOverflow ugh :( you ruined my day :p
 
10:51 AM
@TonyTheTiger f(int* i) is passing a pointer by value (some also say "passing an int by pointer"), whereas f(int& i) is passing an int by reference. In C++, you cannot pass a reference by value. (You can in Java, and that's exactly what happens there.)
 
@FredOverflow cause the reference is really an alias, but the reference itself is not passed by value?
 
Are you talking about C++ references or Java references?
 
@FredOverflow C++
I don't know Java
 
Yes, in C++, there is no such thing as "the value of a reference". A reference is just another name for an existing object.
 
sbi
@DeadMG Good!
 
10:54 AM
The singlemost important difference between pointers and references is, in my opinion at least, that you can bind rvalues to certain kinds of references, but you cannot apply the address-of operator to an rvalue.
That is, you can pass std::string("hello!") to a function taking an lvalue-reference-to-const or an rvalue-reference, but you cannot say &std::string("hello!") and pass that pointer to a function taking a const std::string*.
Because by definition, the & operator only works on lvalues.
 
sbi
@FredOverflow I dunno. In fact, I asked this myself before. I think, over the last one or two decades, the No-new-Keywords policy has acquired quite a few serious dents. I think we're approaching a three digit number of keywords.
 
To me the difference is that between f(int& i) and f(int i) the code can be the same. Between f(int* i) and f(int i) it can't be the same, because you're passing different values, but still just values.
 
@MartinhoFernandes How can "being the same" be considered a difference? :)
 
I meant to illustrate the difference between by-ref and by-pointer. I realize I wasn't very clear... And the 2 minute window is gone :(
@FredOverflow And in C# you can pass references by reference!
 
@MartinhoFernandes That is correct. In C#, val/ref semantics and pass by val/ref are orthogonal.
 
11:10 AM
i have this system in this link: imm.io/5xHu
and there are two figures 6.2 and 6.3 in this link: imm.io/5xFy
i did not understand these two questions :
1.i did not completely understand the figures for this first difference system.
2.the DC component with omega=0, completely removed from the system.. how ? and system is higher frequency relative to low frequency. how ..?
any one can please help me ?
 
This does not look C++ related at all... maybe you should ask a question on mathoverflow or something?
 
i posted question:
-2
Q: first difference system

Misshi all, i have the concept of first different system given in the link and the real ,maginary,phase and magnitude are plotted in this link . i did not completely understand the figures for this first difference system. the DC component with omega=0, completely removed from the system.. how...

but may be its not clear...
 
Already -2? LOL
 
so i am sad... i really need to knwo it..
 
Is it allowed to overload the dereference operator * in C++?
 
11:25 AM
@Nils That ability is on the basis of the STL iterators.
 
ouhhh LTI system.. reminds me of some class I had years ago
so I end up doing &(*it) where it is an iterator if I want a pointer to the data it points to
 
@Nils Hmm... yeah, maybe, I guess, but I'd rather iterate directly over the addresses if possible.
 
@Miss Do you have somebody who you can ask in person? These kind of questions are usually quite hard to explain/discuss via E-Mail or chat..
 
well i understand the figures now ..
but problem is that how did system remove the DC component?
if you see the first order difference system concept you will see there is DC componeny
 
sry that LTI system theory is too far away in my head
 
11:35 AM
ahh
i need some one..
 
@Miss why do you think C++ people are knowledgeable in all topics?
Oh wait, why wouldn't you? :)
 
ah @martinhofernandes : i just share my problem with you people..
 
well people are a bit smarter here then let's say #ubuntu when it comes to engineering topics ;)
I get a linker error when compiling a single file
lol
 
sbi
@Nils You got it while building an executable from a single source file. Compilers never omit linker errors. (Oh, and those are easy to create: just declare something, or include some declaration, that isn't defined in that single file.)
 
@FredOverflow It would be ambigous. C has this notion of that tag name are different from type name that C++ has to support for compatibility (Unix stuct stat stat() for instance) even if it is used quite rarely in other context.
 
11:46 AM
@Nils And it is way over my head :)
 
@sbi Compilers always omit linker errors, because they never emit them. :P
@sbi If you don't use the declared-but-not-defined entity at all, it wouldn't cause errors, right?
 
sbi
@MartinhoFernandes :-x
 
Note that the implementer POV is not the same as the language designer POV. One implementation technique can be used to implement different semantic and a given semantic can be implemented in different way. Some language leave some aspects implementation defined in order to allow different implementation techniques.
IIRC, Ada `in` parameter can be implemented as by reference of by value (exccepted in some cases were by value -- simple types -- or by reference -- tagged types, more or less classes with virtual functions in C++ terms -- is mandated).
 
@AProgrammer you lost me with Ada... but yea I get the bits before
 
@MartinhoFernandes Right. In SFINAE, you declare lots of stuff that isn't defined anywhere.
 
11:54 AM
@TonyTheTiger Ada in parameters are read only parameter. out are write only and in out are read write. out parameter can be implemented as result parameter (more or less the equivalent of function result) or reference and in out as copy-result or reference.
 
What happens if you pass the same thing to two different in parameters?
With references, I expect different effects than with function result.
 
@AProgrammer oh ok, sounds similar to IDL interface definitions, also use in out parameters
 
@MartinhoFernandes If you take into account that for all practical purpose (I don't remember in standardese terms) virtual functions are always used, yes
 
@FredOverflow function result?
 
@TonyTheTiger Don't know about IDL. VHDL and SQL are based on Ada, but I don't know if SQL inherited these notions or not (VHDL does).
 
11:56 AM
@TonyTheTiger Aprogrammer said:
> (more or less the equivalent of function result)
 
@AProgrammer not sure
 
@AProgrammer SQL is based on Ada? Never knew that.
 
@FredOverflow then not sure what that means... @AProgrammer?
 
@TonyTheTiger I guess he means void foo(int& x) vs. int foo() or something.
 
@FredOverflow ah ok, makes sense
 
11:58 AM
I think the term he actually means is "call-by-value-result".
That is, the function gets a copy, modifies the copy, and at the end, writes the updated value back to the original.
 
@FredOverflow ah
 
So I try to write simple functions which serialize std::list but i fail, what's wrong?
http://codepad.org/YygoJRnW
 
You never initialize tmp. Dereferencing an unitialized pointer yields undefined behavior.
 
that's the reason for the crash?
 
Exactly what it says on the can.
 
12:00 PM
ah
sure
 
It seems you are trying to read into a buffer, but you haven't created the buffer yet.
 
but how would you initialize a T *tmp;
can you new T?
 
@TonyTheTiger with new and then delete it
no better idea..
 
@TonyTheTiger Depends on whether T allows that.
 
@Nils that depends on whether T can be a pointer in all cases...
which I don't know if there is cases where this isn't possible? @FredOverflow seems to indicate so
 
12:03 PM
can I restrict the types T can be?
basically it should be foats, doubles, ints and vectors of them
 
Why don't you just say T tmp; without the pointer and then use &tmp instead of tmp and tmp instead of *tmp?
 
@TonyTheTiger Just make all ctors private.
 
@FredOverflow Ah of course..
 
@Nils You cannot serialize a vector by writing a binary representation of the vector object. You will only serialize book-keeping information and lose the actual data which is stored outside of the vector object.
 
uhh and there is no serialization in C++ as there is in Java?
 
12:05 PM
Oh wait, you have an overload for lists. Do you mean list when you say vector? Then you should be fine.
@Nils No, there isn't. That would require built-in runtime reflection. C++ does not have that, thanks to the zero overhead rule.
 
IIRC the Java serialization API is very easy to use..
 
@Nils Yes, but C++ is not Java.
 
@FredOverflow You had me wonder and I checked. I remembered a lot of similarities in the expression syntax, but after checking I misremembered. So if there is an influence it is weaker than I though.
 
that's quite dumb..
 
so IIUC you can specialize either a class template entirely or you can specialize one of it's member functions, but not both?
 
12:07 PM
@MartinhoFernandes Or make operator new private.
 
@FredOverflow hmm interesting
 
@Nils What exactly is dumb?
 
Well I just want to serialize and deserialize my data and lost about half a day with it and it's still not working
 
Have you looked into Boost Serialization?
13
Q: How do you serialize an object in C++?

Bill the LizardI have a small hierarchy of objects that I need to serialize and transmit via a socket connection. I need to both serialize the object, then deserialize it based on what type it is. Is there an easy way to do this in C++ (as there is in Java)? Are there any C++ serialization online code sample...

 
IIUC - if I understand correctly
 
12:11 PM
> There are also mechanisms which let you handle serialization of pointers (complex data structures like tress etc are no problem), derived classes and you can choose between binary and text serialization. Besides all STL containers are supported out of the box.
 
@FredOverflow maybe this should be C++-faq?
or is it not that frequently asked?
 
Personally, I have never seen someone ask about serialization in C++.
But I could still imagine it being a FAQ :)
 
@FredOverflow I've needed it personally, so I might be biased
lol
 
You can go ahead and FAQify it, I wouldn't mind.
 
12:14 PM
void serialize(Archive & ar, const unsigned int version)
{
    ar & degrees;
    ar & minutes;
    ar & seconds;
}
Whoah, that is some strange syntax!
 
@FredOverflow exactly my thought
anybody
7 mins ago, by Tony The Tiger
so IIUC you can specialize either a class template entirely or you can specialize one of it's member functions, but not both?
 
Why not ar << degrees or something?
 
@FredOverflow cause they like to be different it seems!
 
@TonyTheTiger If you specialize a class template, it has no knowledge of the non-specialized version and hence does not know about its member functions.
A class template specialization can have a completely different set of members.
 
hmm
this is what I'm talking about
"However, if you specialize a class template, you must also specialize all member functions. Although it is possible to specialize a single member
function, once you have done so, you can no longer specialize the whole class."
 
12:16 PM
@TonyTheTiger Who said that, and why is it important to you?
 
@FredOverflow its from the template book, and I was just reading it
 
Do they have an example for that claim?
template <typename T>
struct Foo
{
    template <typename U>
    void bar()
    {
    }
};

template <>
struct Foo<int>
{
};
 
@FredOverflow no example that I can see
 
This compiles fine even though Foo<int> has no member functions whatsoever.
Many TMP techniques rely on this, by the way.
 
@FredOverflow hmmm interesting
 
12:20 PM
Foo<int> and Foo<non_int> are distinct types that have little to do with each other.
Whoah, lots of questions on boost serialization on SO!
 
so it seems it's being used quite a bit
 
Is there any part of Boost that is not used quite a bit?
I would say Boost.Spirit :)
group       = '(' >> expression >> ')';
factor      = integer | group;
term        = factor >> *(('*' >> factor) | ('/' >> factor));
expression  = term >> *(('+' >> term) | ('-' >> term));
> Through the magic of expression templates, this is perfectly valid and executable C++ code. The production rule expression is, in fact, an object that has a member function parse that does the work given a source code written in the grammar that we have just declared.
 
http://codepad.org/apcjE9rz
It reads the things it should, but just like 10 time instead of once, why?
 
I don't like the current room description :(
@Nils How do you determine that it is read 10 times? Have you tried stepping throught the code with a debugger?
 
no I just ran it
 
12:27 PM
@FredOverflow you're free to change it
 
ah it doesn't run on codepad, cos it's not allowed to open a file
file.read(..) should return 0 when done, right?
 
@FredOverflow Boost.Spirit looks very difficult
 
@Nils Again, why do you think it reads 10 times? When I run it, I get the following output:
Reading 3.140000
Reading 1.570000
Reading 42.000000
(Yes, I defined M_PI and M_PI_2 myself. They aren't defined in cmath for some reason.)
 
ah lol, because I appended every time the same things at that file
sry about that
 
Isn't hunting non-existing bugs fun? :)
 
12:33 PM
I need to clear my head :)
but thx for the help
 
@FredOverflow so simply said what is the purpose of Boost.Spirit? Lexing and parsing of something, but what?
 
@Tony, Spirit is a DSL embedded in C++ which could replace lex and yacc.
I.E. you define the language parsed.
 
@TonyTheTiger Of anything you want. You write the grammar.
> Spirit is a set of C++ libraries for parsing and output generation implemented as Domain Specific Embedded Languages (DSEL) using Expression templates and Template Meta-Programming. The Spirit libraries enable a target grammar to be written exclusively in C++. Inline grammar specifications can mix freely with other C++ code and, thanks to the generative power of C++ templates, are immediately executable.
 
hy people help me
0
Q: delay system ==> graphical representation of the frequency response

MissTL;DR How is phase in a delay system represented by the equation of a straight line with slope equal to -n? Background: There is delay system concept given in this link: But, I did not understand the phase response of this dely system by diagram. Diagram details are given in this link (crop...

the angle for straight line is : taninverse(sine(omegano)/cos(omegano) )
so if i put omega as pi/2
then i do't get that figure
..
 
Note that I wonder how usable Spirit really is. I remember checking an older version and I had trouble to know how to handle errors in the input (this handling is usually the weak point of parser generators, in Spirit it looked like weaker than usual but I could have been mistaken by some aspect, and it can have evolved).
 
12:41 PM
@FredOverflow sounds cool, but complicated
since I was never good at grammar :)
 
@TonyTheTiger Hence my guess that few people use it :)
 
@FredOverflow heh
I guess I'll have to wait till @Johannes turns up before I get an answer to my question
1
Q: template class member function only specialization

Tony The TigerI am reading the Complete Guide on Templates and it says the following: Where it is talking about class template specialization. However, if you specialize a class template, you must also specialize all member functions. Although it is possible to specialize a single member function,...

 
So, have you learned anything useful from the template book yet?
Or just obscure corner cases? :)
 
@FredOverflow I have learned useful things, since I'm a noob in templates
 
sbi
@FredOverflow Then why don't you do something about it?!
 
12:50 PM
@FredOverflow this is the first one I've encountered
 
@FredOverflow I don't think this is a corner case.
Just a constraint on specialization: you specialize the full class or some of the function members, but doing both has no sense.
 
@AProgrammer ah, see that's different "makes no sense" to "you can no longer"
 
@Tony, IMHO, you can't because it makes no sense. I you don't think so, please show an use case.
 
@AProgrammer It doesn't give any use case or example, i'm asking cause I'm not sure how it is or isn't possible
I'm not saying it's true or not true, I don't know, this is new territory for me
 
1:41 PM
@FredOverflow those constants are not in the standard. But they're probably there, as long as you #define _USE_MATH_DEFINES.
 
They are POSIX. So a suitable _POSIX_C_SOURCE will bring them in a POSIX compliant implementation (I think they are old enough that in fact the value as long as it is numerical doesn't matter for that).
(I doubt _USE_MATH_DEFINES will be usefull on POSIX systems)
 
1:57 PM
@TonyTheTiger, you are designing a embedded system for it?
 
@AProgrammer I wish, hahah
 
2:11 PM
What exactly happens to includes with derivation of classes?
 
@Nils what do you mean?
 
@Nils: #include and inheritance are two completely different systems serving different purposes at different times
why would they have any relation?
 
if I inherit from some classes will I inherit also the includes?
 
@Nils if you include that in that header file or if they are defined in the header, yes
#include "base.h"
inside your derived means that base will be included wherever you include derived
 
well I get <some line>: multiple definitions of blah.. first defined here: <same line>
 
2:15 PM
Did you make the .h files idempotent?
 
and I have #ifndef and #ifdef in place
What does idempotent mean?
 
Idempotence ( ) is the property of certain operations in mathematics and computer science, that they can be applied multiple times without changing the result. The concept of idempotence arises in a number of places in abstract algebra (in particular, in the theory of projectors and closure operators) and functional programming (in which it is connected to the property of referential transparency). The term was introduced by Benjamin Peirce in the context of elements of an algebra that remain invariant when raised to a power, and literally means "(the quality of having) the same power", ...
Basically it means you can #include them twice without problem.
 
ok
 
Which is to say use that #ifndef construct thingy.
"(...) and #ifdef" <- what do you mean? There's usually no #ifdef.
 
Nov 11 '10 at 13:58, by Roger Pate
Don't be vague, be an ace; write a proper test-case!
 
2:19 PM
ah there is no #ifdef, didn't notice.. well I just used #ifndef
 
@Nils: how to write include guards: stackoverflow.com/questions/1744144/…
 
I think the guards should not be the problem
 
hmm, that's just naming advice; wonder if I should edit it with a brief example of #ifndef / #define ... #endif
@Nils they sound like the problem, a test-case would really help
 
yes I know
 
@TonyTheTiger: why did you flag my message?
if someone is being an asshole, you should be able to call them out on it
4
 
2:25 PM
The act of isolating the problem into a simple example that reproduces it tends to keep my question asking rate on SO very low. It's a great debugging technique.
9
 
@FredNurk which message?
 
@FredNurk well it works if I include it in some test file and I haven't written the code where I try to include it, so I guess the problem is not reproducible for you, just forget about it :)
 
yesterday, by Tony The Tiger
@sbi that was the first time I ever flagged anything, but yea I'm proud for my conservatism :) lol
 
@FredNurk I was referencing a message of someone else, I have never flagged a message of yours
 
@Nils some test-cases inherently require multiple files, that is fine; what isn't fine is the opposite: not attempting to reduce to a single-file (because that's usually possible)
@TonyTheTiger then I misunderstood, sorry.
 
2:29 PM
 
@FredNurk sure, no probs
 
@JamesMcNellis is that the cover of a book about BrainFuck?
 
@FredNurk I liked @James' version better
 
me too, but you asked where it came from :)
apparently vim makes you look funnier than acid too (but it's still the best editor around ;)
 
2:54 PM
wazap
 
hallo @JohannesSchaublitb
whats your thoughts on this @JohannesSchaublitb
4
Q: template class member function only specialization

Tony The TigerI am reading the Complete Guide on Templates and it says the following: Where it is talking about class template specialization. However, if you specialize a class template, you must also specialize all member functions. Although it is possible to specialize a single member function,...

 

« first day (206 days earlier)      last day (4728 days later) »