Re: Hard to visualize this statement

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Igor Tandetnik" <itandetnik@xxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D:%23jqxU16QHHA.4832@xxxxxxxxxxxxxxxxxxxxxxx
"Jacky" <jl@xxxxxxxxxx> wrote in message
news:%23daaXs6QHHA.3412@xxxxxxxxxxxxxxxxxxxx
Queue< complex<double> > qc;

I am confused about this data structure, can anyone explain that?

Queue is a template class taking one template parameter. It is
instantiated with the class complex<double> as the value of this
parameter. complex<double> is itself a template instantiation. All in all,
the situation is not much different than, say, calling one function with
the result of another, as in f(g(x)) .

In this particular case, complex<double> is a complex number using fields
of type double for its real and imaginary parts. I'm not sure what Queue
is, but if it's similar to std::queue, Queue< complex<double>
is a queue data structure holding elements of type complex<double>.
Dear Igor,
Thanks for your reply. But I want to see some code in action (some practical
examples)
Thanks once again
Jacky


--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



.



Relevant Pages

  • Re: name binding from one template to another
    ... and could only be resolved when instantiation is done. ... The definition of the term "dependent name" in my copy of the ... Compilers routinely parse template definitions without knowing all the ... template parameter T which the template is instantiated with. ...
    (microsoft.public.vc.language)
  • Re: Avoiding C++ Templates In Cipher Implementation
    ... >> asymmetric ciphers implemented as templates, and they compile without ... sense to have it as a template parameter. ... template instantiation is only a ...
    (sci.crypt)
  • Re: Hard to visualize this statement
    ... Queue is a template class taking one template parameter. ... complexis itself a template instantiation. ...
    (microsoft.public.vc.language)
  • Re: Keeping the template implementation in .C
    ... > It is necessary to compile the whole template code with the type of the ... > correct object code and can not check if the template parameter meets all ... class-independent part of your template class into another class. ...
    (comp.unix.programmer)
  • Re: overload resolution / integral promotion / standard
    ... >consider a template function in the given context, ... >template parameter anyway in this process, since this does not make sense - ... The validity of the instantiation isn't ...
    (comp.lang.cpp)