Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1#include <iostream>
2
3class IntBox {
4 int value;
5public:
6 IntBox(int v) : value(v) {}
7 int getValue() const { return value; }
8};
9
10int main() {
11 IntBox box(42);
12 std::cout << "Value: " << box.getValue() << "\n";
13 return 0;
14}
15

After

1#include <iostream>
2
3template<typename T>
4class Box {
5 T value;
6public:
7 Box(T v) : value(v) {}
8 T getValue() const { return value; }
9};
10
11int main() {
12 Box<int> box(42);
13 std::cout << "Value: " << box.getValue() << "\n";
14 return 0;
15}
16

Before

translation_unit
preproc_include
#include "#include"
system_lib_string "<iostream>"
class_specifier
class "class"
type_identifier "IntBox"
field_declaration_list
{ "{"
field_declaration
primitive_type "int"
field_identifier "value"
; ";"
access_specifier
public "public"
: ":"
function_definition
function_declarator
identifier "IntBox"
parameter_list
( "("
parameter_declaration
primitive_type "int"
identifier "v"
) ")"
field_initializer_list
: ":"
field_initializer
field_identifier "value"
argument_list
( "("
identifier "v"
) ")"
compound_statement
{ "{"
} "}"
function_definition
primitive_type "int"
function_declarator
field_identifier "getValue"
parameter_list
( "("
) ")"
type_qualifier
const "const"
compound_statement
{ "{"
return_statement
return "return"
identifier "value"
; ";"
} "}"
} "}"
; ";"
function_definition
primitive_type "int"
function_declarator
identifier "main"
parameter_list
( "("
) ")"
compound_statement
{ "{"
declaration
type_identifier "IntBox"
init_declarator
identifier "box"
argument_list
( "("
number_literal "42"
) ")"
; ";"
expression_statement (+28 nodes collapsed)
return_statement
return "return"
number_literal "0"
; ";"
} "}"

After

translation_unit
preproc_include
#include "#include"
system_lib_string "<iostream>"
template_declaration
template "template"
template_parameter_list
< "<"
type_parameter_declaration
typename "typename"
type_identifier "T"
> ">"
class_specifier
class "class"
type_identifier "Box"
field_declaration_list
{ "{"
field_declaration
type_identifier "T"
field_identifier "value"
; ";"
access_specifier
public "public"
: ":"
function_definition
function_declarator
identifier "Box"
parameter_list
( "("
parameter_declaration
type_identifier "T"
identifier "v"
) ")"
field_initializer_list
: ":"
field_initializer
field_identifier "value"
argument_list
( "("
identifier "v"
) ")"
compound_statement
{ "{"
} "}"
function_definition
type_identifier "T"
function_declarator
field_identifier "getValue"
parameter_list
( "("
) ")"
type_qualifier
const "const"
compound_statement
{ "{"
return_statement
return "return"
identifier "value"
; ";"
} "}"
} "}"
; ";"
function_definition
primitive_type "int"
function_declarator
identifier "main"
parameter_list
( "("
) ")"
compound_statement
{ "{"
declaration
template_type
type_identifier "Box"
template_argument_list
< "<"
type_descriptor
primitive_type "int"
> ">"
init_declarator
identifier "box"
argument_list
( "("
number_literal "42"
) ")"
; ";"
expression_statement (+28 nodes collapsed)
return_statement
return "return"
number_literal "0"
; ";"
} "}"