Problem card
User YH
Submission Time 2024-02-06 16:15:51
Score 0
Max Time N/A
Max Memory N/A

Compile Error

card.cpp: In function ‘int main()’:
card.cpp:32:15: error: cannot convert ‘Node’ to ‘Node*’ in assignment
32 | end.head = *temp_node;
| ^~~~~~~~~~
| |
| Node
card.cpp:34:19: error: ambiguous overload for ‘operator=’ (operand types are ‘Node’ and ‘Node*’)
34 | ending_node = &end;
| ^~~
card.cpp:5:7: note: candidate: ‘constexpr Node& Node::operator=(const Node&)’ <near match>
5 | class Node {
| ^~~~
card.cpp:5:7: note: conversion of argument 1 would be ill-formed:
card.cpp:34:18: error: invalid user-defined conversion from ‘Node*’ to ‘const Node&’ [-fpermissive]
34 | ending_node = &end;
| ^~~~
card.cpp:11:2: note: candidate is: ‘Node::Node(int)’ <near match>
11 | Node(int new_value=0) {
| ^~~~
card.cpp:11:2: note: conversion of argument 1 would be ill-formed:
card