Hi, today i was doing one exercise and i wrote this constructor for my Book class where one of the parameters was string. Book::Book(std::string a) : author{a} {}
Than typing Book my_book("Johny");
I was not allowed to do this and i kept getting this error
Error 2 error C2797: 'Book::author': list initialization inside member initializer list or non-static data member initializer is not implemented
This usually works for all the other data types, even worked for my Chrono::Date. Than i tryed this and it finally worked Book::Book(std::string a){ author = a;}
Can anyone explain to me why 1st version is not working?