• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

FAQ: Advanced C++ and Modern Design Online Course

Daniel Duffy

C++ author, trainer
Concepts are the heaviest addition, and are really a paradigm shift.

Indeed, but once you get the hang of it it becomes easier.
I have lots of practical examples.

Really exciting. It's all got to do with deciding at which (meta) level to define and subsequently, use "things".

C++:
// Interface contract specification
template<typename T>
    concept IInput = requires (T x) { x.message(); };

template<typename T>
    concept IOutput = requires (T x, const std::string& s) { x.print(s); };

// I/O stuff
template <typename I, typename O> requires IInput<I> && IOutput<O>
    class SUD
{ // System under discussion, using composition

private:
    I i; O o;
public:
    SUD(const I& input, const O& output) : i(input), o(output) {}
    void run()
    { o.print(i.message());    }
};
 
Last edited:

Attachments

  • quantNet_HW1.JPG
    quantNet_HW1.JPG
    22.9 KB · Views: 2
Top