How to read references on this site?

I am a bit confused about the layout of the reference pages on this site. Am I missing a link or something that can explain it as it is confusing me. Take the string::replace reference page for example....

http://www.cplusplus.com/reference/string/string/replace/

Each reference usually starts out with a box at the top. In string.repalces case...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
string (1)	
string& replace (size_t pos,        size_t len,        const string& str);
string& replace (const_iterator i1, const_iterator i2, const string& str);
substring (2)	
string& replace (size_t pos,        size_t len,        const string& str,
                 size_t subpos, size_t sublen);
c-string (3)	
string& replace (size_t pos,        size_t len,        const char* s);
string& replace (const_iterator i1, const_iterator i2, const char* s);
buffer (4)	
string& replace (size_t pos,        size_t len,        const char* s, size_t n);
string& replace (const_iterator i1, const_iterator i2, const char* s, size_t n);
fill (5)	
string& replace (size_t pos,        size_t len,        size_t n, char c);
string& replace (const_iterator i1, const_iterator i2, size_t n, char c);
range (6)	
template <class InputIterator>
  string& replace (const_iterator i1, const_iterator i2,
                   InputIterator first, InputIterator last);
initializer list (7)	
string& replace (const_iterator i1, const_iterator i2, initializer_list<char> il);


And then SOMETIMES not always, it has a section beneath it like so...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Replace portion of string
Replaces the portion of the string that begins at character pos and spans len characters (or the part of the string in the range between [i1,i2)) by new contents:

(1) string
Copies str.
(2) substring
Copies the portion of str that begins at the character position subpos and spans sublen characters (or until the end of str, if either str is too short or if sublen is string::npos).
(3) c-string
Copies the null-terminated character sequence (C-string) pointed by s.
(4) buffer
Copies the first n characters from the array of characters pointed by s.
(5) fill
Replaces the portion of the string by n consecutive copies of character c.
(6) range
Copies the sequence of characters in the range [first,last), in the same order.
(7) initializer list
Copies each of the characters in il, in the same order.

Am I correct in assuming that the number in parenthesis in the bottom box correspond's with the number in the top box? If so, why do some pages (like string.find reference page) not follow the same format?
Am I correct in assuming that the number in parenthesis in the bottom box correspond's with the number in the top box?

Yes, that's correct.

why do some pages (like string.find reference page) not follow the same format?

I don't know. It looks like it's part of the same section as the rest of the descriptive text so maybe they just didn't think it was necessary for some descriptions. A list like that for find would probably just repeat itself. You've still got the short descriptive words (string, c-string, buffer, character) on the left side of the box that describes each overload. If you are unsure about some parameters you can always look it up in the parameter section further down the page.
Last edited on
I would think that the numbers denote different behaviors of a function with the same name but different parameters.
In the case of std::find, the description of parameter s does refer to two of the four variants:
If argument n is specified (3), the sequence to match are the first n characters in the array.
Otherwise (2), a null-terminated sequence is expected: the length of the sequence to match is determined by the first occurrence of a null character.



Does the lack of same format on every page significantly reduce the conveyed information?
Topic archived. No new replies allowed.