MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / main

Function main

Source Code/23-05.cpp:6–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <iostream>
5#include <vector>
6int main() {
7 // A vector is allocated and initialized
8 std::vector<int> v { 12 };
9 const int& ref_to_first = v[0]; // A reference to it is taken
10 v.push_back(13); // The vector is mutated
11 std::cout << ref_to_first; // The reference accesses the vector
12 // The vector is implicitly deallocated
13}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected