Code view:
From the node mapping Full Minimal
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
3 class Resource {
4 public:
5 Resource() { std::cout << "Resource acquired\n"; }
6 ~Resource() { std::cout << "Resource released\n"; }
7 };
8
9 int main() {
10 Resource * res = new Resource ();
11 // Use resource
12 return 0;
13 }
14
After
1 #include <iostream>
2 #include <memory>
3
4 class Resource {
5 public:
6 Resource() { std::cout << "Resource acquired\n"; }
7 ~Resource() { std::cout << "Resource released\n"; }
8 };
9
10 int main() {
11 std::unique_ptr< Resource > res = std::make_unique< Resource > ();
12 // Use resource
13 return 0;
14 }
15
Before
1 #include <iostream>
2
3 class Resource {
4 public:
5 Resource() { std::cout << "Resource acquired\n"; }
6 ~Resource() { std::cout << "Resource released\n"; }
7 };
8
9 int main() {
10 Resource * res = new Resource ();
11 // Use resource
12 return 0;
13 }
14
After
1 #include <iostream>
2 #include <memory>
3
4 class Resource {
5 public:
6 Resource() { std::cout << "Resource acquired\n"; }
7 ~Resource() { std::cout << "Resource released\n"; }
8 };
9
10 int main() {
11 std::unique_ptr< Resource > res = std::make_unique< Resource > ();
12 // Use resource
13 return 0;
14 }
15
Before
1 #include <iostream>
2
3 class Resource {
4 public:
5 Resource() { std::cout << "Resource acquired\n"; }
6 ~Resource() { std::cout << "Resource released\n"; }
7 };
8
9 int main() {
10 Resource* res = new Resource();
11 // Use resource
12 return 0;
13 }
14
After
1 #include <iostream>
2 #include <memory>
3
4 class Resource {
5 public:
6 Resource() { std::cout << "Resource acquired\n"; }
7 ~Resource() { std::cout << "Resource released\n"; }
8 };
9
10 int main() {
11 std::unique_ptr< Resource> res = std::make_unique< Resource> ();
12 // Use resource
13 return 0;
14 }
15
Before
translation_unit preproc_include #include "#include"
system_lib_string "<iostream>"
class_specifier (+55 nodes collapsed)
; ";"
function_definition primitive_type "int"
function_declarator identifier "main"
parameter_list ( "("
) ")"
compound_statement { "{"
declaration type_identifier "Resource"
init_declarator pointer_declarator * "*"
identifier "res"
= "="
new_expression new "new"
type_identifier "Resource"
argument_list ( "("
) ")"
; ";"
comment "// Use resource"
return_statement return "return"
number_literal "0"
; ";"
} "}"
After
translation_unit preproc_include #include "#include"
system_lib_string "<iostream>"
preproc_include #include "#include"
system_lib_string "<memory>"
class_specifier (+55 nodes collapsed)
; ";"
function_definition primitive_type "int"
function_declarator identifier "main"
parameter_list ( "("
) ")"
compound_statement { "{"
declaration qualified_identifier namespace_identifier "std"
:: "::"
template_type type_identifier "unique_ptr"
template_argument_list < "<"
type_descriptor type_identifier "Resource"
> ">"
init_declarator identifier "res"
= "="
call_expression qualified_identifier namespace_identifier "std"
:: "::"
template_function identifier "make_unique"
template_argument_list < "<"
type_descriptor type_identifier "Resource"
> ">"
argument_list ( "("
) ")"
; ";"
comment "// Use resource"
return_statement return "return"
number_literal "0"
; ";"
} "}"
Keybindings
j / k next / previous visible node (tree panels)
h / l collapse / expand the focused node
g / G jump to first / last visible node
Tab switch focus between Before/After panels
/ search: jump to next node whose text contains a given string
a jump the other panel to this node's mapped counterpart
i hide identical matches, showing only inserted/deleted/updated nodes and their ancestors
v cycle the view: split / code only / tree only
p cycle what the code view renders: the node mapping, then each human painting
r mark this fixture as reviewed, or forget the mark (kept in this browser only)
n open a random fixture not yet marked as reviewed
? toggle this help
Search (plain substring, no regex):