| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> :P <1> I mean I have this: template< typename A, typename B > struct R{}; template< typename A, typename B > struct S; and I want to specialize S where B is any R <1> it might not be possible <0> hey! <0> that's exactly what i need!!! <1> I doubt it <0> dude.. tell me if u get the answer <0> i'm trying to build a Gram matrix <0> of all permutated combinations of a finite set of objects <0> permuted <0> and i want the user to p*** in a templated Functor <0> for each term in my Gram matrix.. <1> functors shouldn't be a problem <0> however, the type for such a functor really "fixes" the cl*** definition <1> they're just a type that you can use operator() on <0> but the functor itself.. is a template..
<1> shouldn't matter <0> template<cl*** T1, cl*** T2> cl*** TBinOp <0> {public: virtual T2 operator()(T1 &a, T1 &b) = 0;}; <0> that's my functor for Binary Operations <1> template <typename T> call_functor( T functor ){ functor(); } <1> throw a void in there for return type <1> just look at how the standard library does it <1> check out for_each, and all of those <0> yeah, but notice that u used T already for the functor parameters? that affects the Gram matrix builder that accepts the Functor <1> not really <1> I only templated a function <1> which is the same sorta thing we just tried to show you how to do <0> Tensor<T> EigenSolver<T>::buildAffMatrix(T2 *v, int n, TBinOp<T2, T2> &binOp) <1> struct A{ template <typename T> void call_functor( T functor ){ functor(); } }; <1> there <1> the functors you use don't affect A at all <1> yeah? <0> but look here: <1> template< typename T > struct A{ template <typename FunctorType> void call_functor( FunctorType functor ){ functor(); } }; <0> void call_functor( T functor ) << u already specified that this member function only accepts T type functors.. but i'd like that T to be some variant.. like. decided at runtime <1> well there's your problem <1> templates aren't a runtime thing <1> runtime polymorphism usually == virtual functions <1> templates are a generic programming tool <0> OK.. i see what you're doing now <0> so you're saying.. u can localize the template specialization by declaring the template args at the member function level.. this way it won't affect the carrying cl*** <1> no, it's not a specialization <1> it's simply a template member function <0> wait.. is that even possible? <1> template member functions? yes, I just showed you one <0> i can declare the cl*** without <T1, T2> <0> and use a member function with <T1 T2> <0> ? <1> that's what we've been showing you how to do for awhile <0> hmm <1> template< typename T > struct A{ template< typename T2 > void foo(){} }; int main(){ A<int> a; a.foo<float>(); a.foo<char>(); } <2> hi all <2> should strcat work also in C? <1> also? <1> strcat originated with C <2> so it's ok.. <2> ? <1> this is #C++, by the way <1> C is in #C <2> what's their key today? <2> i dont know <1> should be main <1> /join #C main <1> you're welcome <1> oh, figured out my nonsense anyway <0> thanks~~ rdragon you're the best <0> rdragon <0> template< typename T > struct A{ template< typename T2 > void foo(){} }; int main(){ A<int> a; a.foo<float>(); a.foo<char>(); } <1> yes? <1> i think you need to hit the books <1> like AC++, or meyers <3> What's AC++? <3> hello <1> http://www.rudbek.com/books.html <1> AC++ = accelerated C++ <1> I'm off to bed
<3> ok thx :) <4> hi <0> is template nesting even legal? <0> damnit vc6 sucx <5> its that time of year for nesting ok <5> in the northern hemisphere <0> Is it possible to specialise a member function of a cl*** template without specialising the whole template? <5> yes <0> k <5> not with VC6 <0> yup. i just discovered <5> which is why we said dump vc6 <5> its just not worth the pain <6> In case we didn't mention it, yet: dump vc6 <0> haha <0> okok already <6> skip over vc 7.0 <5> vc8 is free <6> Use 7.1 or 8.0 <0> is there some service pack for vc6 that will enable template member specialization <5> nuke your p0rn collection and free up the space <0> or some cheat code <6> dextre1: no <0> hey. leave my porn collection out of this <5> not a chance <4> why get a service pack for vc6, if vc8 is free? <4> and i deleted half my porn collection lately, i feel guilty :/ <5> if you want to write something approaching c++ dump vc6 :) just in case we forgot to mention it <0> u'll be missing it <6> Although there were several sevice packs, none of them fixed the most important problems of VC6. <0> why is vc a half baked piece of crap <0> vc6 <5> its very old <5> nearly 10 years <4> the better question is why do people still use it? <5> an eternity in computing <0> is there a way to tell if a cl***'s method is being used as an LHS or RHS in code? <0> is it possible to p*** a functor that carries more information than specified in the operator() arguments? <0> like.. in the constructor? i find it hard to tell apart the syntax for "operator()" and an ordinary constructor. <0> for instance.. if i want to build a functor that calculates scaled euclidean distance.. in addition to the 2 arguments that are p***ed as arguments into the functor operator(), there needs an extra standard deviation factor to scale the difference.. is there a way to "preset" the functor to know my stdDev in advance so i don't have to p*** it in the operator() arguments? <6> Yes, that is called binding. <6> You should check out Boost.Bind at http://boost.org/ <0> wait. i asked a stupid question <0> got it thanks <0> i thought i was calling the () when i p***ed the functor.. but in fact i was using the default constructor <5> having a brain fart moment: <5> struct base {//stuff}; struct other : public base {//more stuff}; <5> dosome(base& thing) <5> can I p*** a other into this ? <5> w/o slicing <0> what is slicing.. i see that a lot <5> bits of the cl*** getting chopped off <5> sort of <0> that sounds horrible <0> why does it happen <6> bealtine: a reference doesn't cause slicing. The slicing will happen if you copy. <5> copy as in ? <6> dextre1: it happens when you do something like this: derived d; base b = d; // b will not be a complete copy of d <5> i need to get an "other" to p*** and sometimes a base <6> References don't create new object, so p***ing by reference doesn't cause any slicing. <0> i see! <5> however when I p*** the "other" it seems to slice <6> However, if you copy later then using a reference won't help. E.g. vector<base> v; v.push_back(d); // will cause slicing although push_back takes a reference. <0> roll your own operator= <6> dextre1: no, that won't work well. <5> I dont think that will work <5> i'm just trying to make this silly C style protocol work "nicely" <7> Who Can Help Me?! <5> did you ask a question? <7> I Want To Learn The Fonctionnement Of Graphe In langage C <5> joic #c <7> can You Give me Some Pages Web Traiting It?? <5> ./join #c main
Return to
#c++ or Go to some related
logs:
#london install urpmi +ubuntu kndels #MissKitten tequila Cure For Shyness Mrxvt screenrc what does works toilet cleaner contain #AllNiteCafe #c dan_feld
|
|