Skip to content

Commit

Permalink
Made formatting more consistent in examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lastique committed Jan 30, 2024
1 parent 989676e commit 080e810
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions doc/scope_guards.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ construction. For example, the following four pieces of code have the same effec
[[`scope_fail`][`scope_exit` with a condition][`scope_exit` with embedded condition][`scope_exit` with manual deactivation]]
[[
```
void push_back(int x, std::vector<int>& vec1,
std::vector<int>& vec2)
void push_back(int x, std::vector< int >& vec1,
std::vector< int >& vec2)
{
vec1.push_back(x);

Expand All @@ -296,8 +296,8 @@ void push_back(int x, std::vector<int>& vec1,
]
[
```
void push_back(int x, std::vector<int>& vec1,
std::vector<int>& vec2)
void push_back(int x, std::vector< int >& vec1,
std::vector< int >& vec2)
{
vec1.push_back(x);

Expand All @@ -314,8 +314,8 @@ void push_back(int x, std::vector<int>& vec1,
]
[
```
void push_back(int x, std::vector<int>& vec1,
std::vector<int>& vec2)
void push_back(int x, std::vector< int >& vec1,
std::vector< int >& vec2)
{
vec1.push_back(x);

Expand All @@ -335,8 +335,8 @@ void push_back(int x, std::vector<int>& vec1,
]
[
```
void push_back(int x, std::vector<int>& vec1,
std::vector<int>& vec2)
void push_back(int x, std::vector< int >& vec1,
std::vector< int >& vec2)
{
vec1.push_back(x);

Expand Down Expand Up @@ -1214,7 +1214,7 @@ This feature can be emulated in TS using additional state that the scope guard a
```
// Insert value into both containers and call on_inserted() afterwards.
// Maintain both containers intact if an exception is thrown.
void insert_two(std::vector<int>* pv, std::set<int>& set, int value)
void insert_two(std::vector< int >* pv, std::set< int >& set, int value)
{
// Initially inactive scope guard
boost::scope::scope_fail pv_rollback([pv] { pv->pop_back(); }, false);
Expand All @@ -1236,7 +1236,7 @@ void insert_two(std::vector<int>* pv, std::set<int>& set, int value)
```
// Insert value into both containers and call on_inserted() afterwards.
// Maintain both containers intact if an exception is thrown.
void insert_two(std::vector<int>* pv, std::set<int>& set, int value)
void insert_two(std::vector< int >* pv, std::set< int >& set, int value)
{
bool pv_inserted = false;
// Initially active scope guard, but blocked by pv_inserted == false
Expand Down

0 comments on commit 080e810

Please sign in to comment.