aboutsummaryrefslogtreecommitdiffstats
path: root/docs/CodingStandards.html
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-23 16:25:38 +0000
committerChris Lattner <sabre@nondot.org>2003-04-23 16:25:38 +0000
commitf7235cde69c7017aecbc6609ee3db2fc81ad2668 (patch)
treedf8c7a700e1846a434cc12f113d044324e45d9dd /docs/CodingStandards.html
parent155e68feea21534d69be3cdbcc16991398b7664a (diff)
downloadexternal_llvm-f7235cde69c7017aecbc6609ee3db2fc81ad2668.zip
external_llvm-f7235cde69c7017aecbc6609ee3db2fc81ad2668.tar.gz
external_llvm-f7235cde69c7017aecbc6609ee3db2fc81ad2668.tar.bz2
Properly convert some &'s to &amp;'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/CodingStandards.html')
-rw-r--r--docs/CodingStandards.html32
1 files changed, 16 insertions, 16 deletions
diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html
index 8566e67..83ca1dc 100644
--- a/docs/CodingStandards.html
+++ b/docs/CodingStandards.html
@@ -378,9 +378,9 @@ you actually implement it. Typically it looks something like this
public std::iterator<std::forward_iterator_tag, value_type> {
friend class container;
public:
- const value_type& operator*() const;
+ const value_type&amp; operator*() const;
const value_type* operator->() const;
- const_iterator& operator++();
+ const_iterator&amp; operator++();
const_iterator operator++(int);
friend bool operator==(const_iterator lhs,
const_iterator rhs);
@@ -408,14 +408,14 @@ two constructors with different signatures.]</i>
There are normally only three member functions that need nontrivial
implementations; the rest are just boilerplate.
- const container::value_type&
+ const container::value_type&amp;
container::const_iterator::operator*() const {
// find the element and return a reference to it
}
const container::value_type*
container::const_iterator::operator->() const {
- return &**this;
+ return &amp;**this;
}
If there's an underlying real container, operator*() can just return a
@@ -431,7 +431,7 @@ when one of the dereferencing operators is called.
The operator->() function is just boilerplate around a call to
operator*().
- container::const_iterator&
+ container::const_iterator&amp;
container::const_iterator::operator++() {
// the incrementing logic goes here
return *this;
@@ -491,9 +491,9 @@ the simple addition of a second class.
friend class container;
friend class container::const_iterator;
public:
- value_type& operator*() const;
+ value_type&amp; operator*() const;
value_type* operator->() const;
- iterator& operator++();
+ iterator&amp; operator++();
iterator operator++(int);
friend bool operator==(iterator lhs, iterator rhs);
friend bool operator!=(iterator lhs, iterator rhs);
@@ -505,10 +505,10 @@ the simple addition of a second class.
friend class container;
public:
const_iterator();
- const_iterator(const iterator& i);
- const value_type& operator*() const;
+ const_iterator(const iterator&amp; i);
+ const value_type&amp; operator*() const;
const value_type* operator->() const;
- const_iterator& operator++();
+ const_iterator&amp; operator++();
const_iterator operator++(int);
friend bool operator==(const_iterator lhs,
const_iterator rhs);
@@ -537,7 +537,7 @@ iterators:
public std::iterator<std::bidirectional_iterator_tag, value_type> {
public:
//...
- iterator& operator--();
+ iterator&amp; operator--();
iterator operator--(int);
//...
};
@@ -551,8 +551,8 @@ Random access iterators add several more member and friend functions:
public std::iterator<std::random_access_iterator_tag, value_type> {
public:
//...
- iterator& operator+=(difference_type rhs);
- iterator& operator-=(difference_type rhs);
+ iterator&amp; operator+=(difference_type rhs);
+ iterator&amp; operator-=(difference_type rhs);
friend iterator operator+(iterator lhs, difference_type rhs);
friend iterator operator+(difference_type lhs, iterator rhs);
friend iterator operator-(iterator lhs, difference_type rhs);
@@ -564,13 +564,13 @@ Random access iterators add several more member and friend functions:
//...
};
- container::iterator&
+ container::iterator&amp;
container::iterator::operator+=(container::difference_type rhs) {
// add rhs to iterator position
return *this;
}
- container::iterator&
+ container::iterator&amp;
container::iterator::operator-=(container::difference_type rhs) {
// subtract rhs from iterator position
return *this;
@@ -660,7 +660,7 @@ If you get some free time, and you haven't read them: do so, you might learn som
<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
<!-- Created: Tue Jan 23 15:19:28 CST 2001 -->
<!-- hhmts start -->
-Last modified: Sun Jan 20 13:01:02 CST 2002
+Last modified: Wed Apr 23 11:20:49 CDT 2003
<!-- hhmts end -->
</font>
</body></html>