Size: a a a

2021 February 28

DK

David Kravets in supapro.cxx
<stdin>:2:3: error: use of undeclared identifier 'std'
 std::string path;
источник

LA

Liber Azerate in supapro.cxx
David Kravets
<stdin>:2:3: error: use of undeclared identifier 'std'
 std::string path;
Ты это вот серьёзно?
источник

DK

David Kravets in supapro.cxx
<stdin>:6:11: error: use of undeclared identifier 'std'
 A(const std::string& val){
         ^
источник

LA

Liber Azerate in supapro.cxx
David Kravets
<stdin>:6:11: error: use of undeclared identifier 'std'
 A(const std::string& val){
         ^
*facepalm*
источник

AZ

Alexander Zaitsev in supapro.cxx
ну так заинклудь
источник

DK

David Kravets in supapro.cxx
Liber Azerate
Ты это вот серьёзно?
Не ту ошибку отправил
источник

LA

Liber Azerate in supapro.cxx
David Kravets
Не ту ошибку отправил
Я так понял это та? :)
https://t.me/supapro/843151
источник

LA

Liber Azerate in supapro.cxx
С приходом 23-го стандарта
источник

DK

David Kravets in supapro.cxx
Liber Azerate
С приходом 23-го стандарта
Вы меня вообще запутали
источник

DK

David Kravets in supapro.cxx
Liber Azerate
С приходом 23-го стандарта
Вообще то идея была чтобы удалить конструктор
источник

DK

David Kravets in supapro.cxx
Liber Azerate
С приходом 23-го стандарта
#include <iostream>

using namespace std;

struct A{
 std::string path;
 
 A(const std::string& val){
   this->path = val;
   std::cout << "constructor string" << std::endl;
 }
};
struct B : public A {
 A a;
 B() : a("123"){
   std::cout << a.path << std::endl;
 }
};
int main() {
 B b;
 return 0;
}
/*
stdout:
constructor base
constructor string
123
*
источник

C

CodeDetector in supapro.cxx
David Kravets
#include <iostream>

using namespace std;

struct A{
 std::string path;
 
 A(const std::string& val){
   this->path = val;
   std::cout << "constructor string" << std::endl;
 }
};
struct B : public A {
 A a;
 B() : a("123"){
   std::cout << a.path << std::endl;
 }
};
int main() {
 B b;
 return 0;
}
/*
stdout:
constructor base
constructor string
123
*
Оберните код в теги: 3 символа ` до и после кода (в случае одиночной конструкции достаточно 1 ` с обеих сторон). Спасибо!
источник

DK

David Kravets in supapro.cxx
Liber Azerate
С приходом 23-го стандарта
Просто удалить его нельзя
источник

DK

David Kravets in supapro.cxx
Выйдет ошибка
источник

DK

David Kravets in supapro.cxx
Liber Azerate
С приходом 23-го стандарта
<stdin>:15:3: error: constructor for 'B' must explicitly initialize the base class 'A' which does not have a default constructor
 B() : a("123"){
 ^
источник

C

CodeDetector in supapro.cxx
David Kravets
<stdin>:15:3: error: constructor for 'B' must explicitly initialize the base class 'A' which does not have a default constructor
 B() : a("123"){
 ^
Оберните код в теги: 3 символа ` до и после кода (в случае одиночной конструкции достаточно 1 ` с обеих сторон). Спасибо!
источник

LA

Liber Azerate in supapro.cxx
David Kravets
#include <iostream>

using namespace std;

struct A{
 std::string path;
 
 A(const std::string& val){
   this->path = val;
   std::cout << "constructor string" << std::endl;
 }
};
struct B : public A {
 A a;
 B() : a("123"){
   std::cout << a.path << std::endl;
 }
};
int main() {
 B b;
 return 0;
}
/*
stdout:
constructor base
constructor string
123
*
Ну код-то не такой там был
источник

LA

Liber Azerate in supapro.cxx
David Kravets
Просто удалить его нельзя
А твой совет удалить, да, плохой
источник

DK

David Kravets in supapro.cxx
Liber Azerate
А твой совет удалить, да, плохой
Эт не мой совет
источник

LA

Liber Azerate in supapro.cxx
David Kravets
Эт не мой совет
источник