Explain C++ code

后端 未结 3 1077
执念已碎
执念已碎 2021-01-17 06:11

Can I get some help with explanation of the following code?

#include 

class Vector {
    private:
        double∗ elem; // pointer to the el         


        
3条回答
  •  无人及你
    2021-01-17 06:43

    Maybe it's the new C++11 initialisation-lists that are confusing you, you now can initialise a variable with curly-braces {}. For example:

    int i{42};
    std::vector v{1, 2, 3, 4};
    

    everything else in your code looks pretty standard pre-C++11

提交回复
热议问题