| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> thanks <0> now it works, ill stop to disturb you <0> really thanks <1> void f(int param); <1> #define and * <1> #define on -1 <1> f(3 and on); <2> yes, it is <1> or 'beyond' instead of 'on'? :) <2> uh? <1> Hey, I don't know english <1> I started with an enum, with members like: <1> param3 = 3; <1> param3onwards = -3; <1> But well... hmpf
<0> hmpf :p <1> Maybe like this: f(3); or f(3, and_onwards); <1> heheh <1> At least I don't need macros then :p <0> but Run.. suppose I do template <0> damn, template <typename T> T foo() { return ...; } <0> I need typename like: typename T foo() ? <3> No, because the compiler already knows that T is a type. <3> However, it doesn't know that T::whatever is a type unless you say so. <0> ok <1> or typename Foo<T>::whatever <0> you type faster than me :p <3> You already said "typename T" in the template declaration. <1> Hmm <1> Actually, it might know what when Foo<> is known. <1> But I guess it doesn't keep track of specializations, so you still have to specify it there. <0> but why the compiler doesn't know that T::whatever is a type.. <1> cl*** A { <0> it is still declared template <typename T> <3> CocaCola^: How would it? <1> typedef int whatever; }; <1> cl*** B { <3> CocaCola^: Maybe "whatever" is a static member. <1> int whatever; }; <1> heh - static int :) <0> hmpf :p <0> template <typename T, typename C = list<T> > void print(C<T>& he) { } <1> static boost::shared_ptr<Matcher> create(Identity* identity, int param, match0_type mt, bool single_param = true); <0> is it possible to do that? : p <2> CocaCola^ why would you need that? <1> list<T><T> is nonsense <0> I shoudl use typename C = list <0> only ? <1> template <typename T, typename C = std::list<T> > void print(C& he) { } <1> hmpf <1> template<typename T, typename C = std::list<T> > void print(C& he) { } <0> it tells me: default template arguments may not be used in function templates <1> I don't think it will be able to figure out what T is by itself then though. <1> If C is an STL container, you'd either do: <1> template<typename C = std::list<T> > void print(C& he) { } // use typename C::value_type to get T. <1> or <1> template<typename T> void print(std::list<T>& he) { } <0> how can you use T if you don't define it <1> Don't use it <1> use typename C::value_type <0> <1> template<typename C = std::list<T> > <1> Oh.. hm <1> You're right <1> I never wrote a template that can take any type of container :/ <0> oh cool <0> well, im trying all kind of stuff really <1> It's possible to p*** a template (ie, just 'list') but I don't know how. <0> but I just hate to follow tutorial and when examples don't work <1> This is from AC++ ? <0> nop <0> im just talking in general <4> i like the GUI of Winamp <4> player <4> lot better than windows mediay player <0> agree <4> i wonder what GUI Builder they're usin
<1> CocaCola^: I looked it up, you can do: <1> template<template<cl*** U> cl*** V> cl*** C { ... <0> oh <0> ok <0> where did you look <1> So, maybe you want: template<template<typename T> C = std::list> void print(C<T>& he); <1> however, I doubt it will work for functions. <1> This example is for another cl***, not a template function. <1> In the standard - 14.3.3 <2> why would you need to write a print function templated to a container of T? <0> it becomes complex <2> just copy the elements to output <0> what do you mean <0> I want to use print(d); d can be list<char> vector<bleh> deque <int> <2> or you can just do things normally <2> until we get concepts <2> d can also be int <2> well, maybe not int, <2> but the whole design of the std library is to use algorithms for that stuff <2> er <2> iterators <2> sigh, tired and frustrated <0> ok but how can u get iterator <0> in print definition <0> void print(......::iterator b, ...::iterator e) { } <0> if you don't know which type of iterator <2> you don't need to write a print() at all <0> lol :p <2> std::copy( c.begin(), c.end(), std::ostream_iterator<element_type>(cout, " ") ); <2> see, all done <0> cool <0> hehe :p <5> cl*** a { int x(); }; cl*** b { int x(int y); }; cl*** c : public a, public b { }; <5> shouldn't c inherit both functions? <5> they're all public <3> sk8ing: They are? You didn't write them that way. <5> public: in both a and b <3> sk8ing: Where? <5> now they are :) <5> come on.. I know how to write a cl***. cl*** a { public: int x(); }; <5> same with b <3> Don't know, then. <2> sk8ing how about describing your problem <1> I don't know either... it could be that it first finds the scope of x, and then tries to resolve overloading... <5> in the same scope? <1> The scope if different. <1> is <3> sk8ing: Are you qualifying x() when referencing it as a member of c? <5> well I'm trying to do something like c x; x->x(10); and it's not working <3> sk8ing: Of course not. That's ambiguous. <5> no it's not <3> In c, it is. <1> x.x(10); you mean <5> yeah... x.x <1> x.b::x(10); should work <1> but you can put both x explicitely in c <6> hi all. can anyone explain me how to use the lib with dll in my code when I don't have a header file? (using dev-cpp5) <1> with a using, i think <1> cl*** c .... { using a::x; using b::x; <2> struct C: A, B{ using A::x; using B::x' }; <2> ; <5> interesting, thanks <3> danilov: What library is it, and why aren't there headers for it? <6> it is bpmDetect... wait a sec...I'll find the link....and it has a header file, but it's not working, so it's the same as if there was no .h file.... <1> Ah, you're still in the stage "It doesn't work, so I'll delete it". <3> You should probably figure out why it doesn't work. <1> Hmm, I never got into that stage in the first place, actually. <3> You might save yourself a great deal of effort... and probably program errors, besides. <6> well....hm...it just declares functions....when I try using them the linker says the thing about undefined reference... <3> danilov: Did you remember to link the library? <6> yes <3> Did you remember to link its dependencies? <3> Did you do the same for any other libraries you might be linking?
Return to
#c++ or Go to some related
logs:
#linux #php q lazzarus wild horses disable flash in firefox #php hfojs
#london supt pula saveitfree review #london
|
|