1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <string> using namespace std; struct N { N(const string & t_) { } }; int main() { string s1 = string("bananas"); string s2 = "bananas"; N n1 = string("bananas"); N n2 = "bananas"; }
1 2 3
In function 'int main()': Line 13: error: conversion from 'const char [8]' to non-scalar type 'N' requested compilation terminated due to -Wfatal-errors.