mirror of
https://github.com/reactos/CMake.git
synced 2024-11-27 21:41:03 +00:00
Merge topic 'doc-cmake-developer-no-cmStdString'
328c2179
Help: Drop cmStdString from cmake-developer(7) examples
This commit is contained in:
commit
e623605ed6
@ -55,7 +55,7 @@ used in a comparison with the iterator returned by ``end()``:
|
|||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
const std::set<cmStdString>& someSet = getSet();
|
const std::set<std::string>& someSet = getSet();
|
||||||
if (someSet.find("needle") == someSet.end()) // Wrong
|
if (someSet.find("needle") == someSet.end()) // Wrong
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
@ -66,8 +66,8 @@ The return value of ``find()`` must be assigned to an intermediate
|
|||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
const std::set<cmStdString>& someSet;
|
const std::set<std::string>& someSet;
|
||||||
const std::set<cmStdString>::const_iterator i = someSet.find("needle");
|
const std::set<std::string>::const_iterator i = someSet.find("needle");
|
||||||
if (i != propSet.end()) // Ok
|
if (i != propSet.end()) // Ok
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
@ -110,7 +110,7 @@ conversion is not allowed:
|
|||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
std::set<cmStdString> theSet;
|
std::set<const char*> theSet;
|
||||||
std::vector<std::string> theVector;
|
std::vector<std::string> theVector;
|
||||||
theVector.insert(theVector.end(), theSet.begin(), theSet.end()); // Wrong
|
theVector.insert(theVector.end(), theSet.begin(), theSet.end()); // Wrong
|
||||||
|
|
||||||
@ -118,9 +118,9 @@ A loop must be used instead:
|
|||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
std::set<cmStdString> theSet;
|
std::set<const char*> theSet;
|
||||||
std::vector<std::string> theVector;
|
std::vector<std::string> theVector;
|
||||||
for(std::set<cmStdString>::iterator li = theSet.begin();
|
for(std::set<const char*>::iterator li = theSet.begin();
|
||||||
li != theSet.end(); ++li)
|
li != theSet.end(); ++li)
|
||||||
{
|
{
|
||||||
theVector.push_back(*li);
|
theVector.push_back(*li);
|
||||||
|
Loading…
Reference in New Issue
Block a user