hsf-training / cpluspluscourse

C++ Course Taught at CERN, from Sebastien Ponce (LHCb)
Apache License 2.0
157 stars 58 forks source link

Clarify instructions of template exercise #476

Closed bernhardmgruber closed 1 year ago

bernhardmgruber commented 1 year ago

Some students in the JLab afternoon lecture tried to build a Complex<std::string>. Make this less likely to happen again.

bernhardmgruber commented 1 year ago

Hmm, do we really want to show:

    std::cout << "Int Complex\n";
    using IComplex = Complex_t<int>;
    OrderedVector<IComplex> vci(5);
...
    std::cout << "Very Complex\n";
    using VComplex = Complex_t<Complex>;
    OrderedVector<VComplex> vcv(5);

in the solution?

bernhardmgruber commented 1 year ago

Hmm, do we really want to show:

    std::cout << "Int Complex\n";
    using IComplex = Complex_t<int>;
    OrderedVector<IComplex> vci(5);
...
    std::cout << "Very Complex\n";
    using VComplex = Complex_t<Complex>;
    OrderedVector<VComplex> vcv(5);

in the solution?

Yes, it's the bonus exercise ..

hageboeck commented 1 year ago

Hmm, do we really want to show:

    std::cout << "Int Complex\n";
    using IComplex = Complex_t<int>;
    OrderedVector<IComplex> vci(5);
...
    std::cout << "Very Complex\n";
    using VComplex = Complex_t<Complex>;
    OrderedVector<VComplex> vcv(5);

in the solution?

I guess with explanation it's OK. Mathematically, it might not make sense, but you can sort them ...