Thread overview
Please add the sample code to the document.
Jul 15, 2020
zoujiaqing
Jul 15, 2020
aberba
Jul 15, 2020
Paul Backus
Jul 18, 2020
zoujiaqing
July 15, 2020
look this doc, not found some examples:
https://dlang.org/phobos/core_stdcpp_string.html

look php doc, have it:
https://www.php.net/manual/en/mysqli.query.php
July 15, 2020
On Wednesday, 15 July 2020 at 02:01:14 UTC, zoujiaqing wrote:
> look this doc, not found some examples:
> https://dlang.org/phobos/core_stdcpp_string.html
>
> look php doc, have it:
> https://www.php.net/manual/en/mysqli.query.php

Yeah, the PHP docs is the gold standard. Part of why PHP is relatively easy to pick up especially for new users.

With D, we're still getting there. I'm looking into the website documentation. Trying to figure out how to contribute to the docs myself.
July 15, 2020
On Wednesday, 15 July 2020 at 02:01:14 UTC, zoujiaqing wrote:
> look this doc, not found some examples:
> https://dlang.org/phobos/core_stdcpp_string.html
>
> look php doc, have it:
> https://www.php.net/manual/en/mysqli.query.php

I think D's policy is not to provide its own duplicated documentation for bindings to the C and C++ standard libraries. It might be a good idea to link to the <string> documentation on cppreference.com [1], though.

The D docs *should* provide an example for how to default-construct a C++ basic_string, since the D API in that case is different from the C++ version.

[1] https://en.cppreference.com/w/cpp/header/string
July 18, 2020
On Wednesday, 15 July 2020 at 14:04:04 UTC, Paul Backus wrote:
> On Wednesday, 15 July 2020 at 02:01:14 UTC, zoujiaqing wrote:
>> look this doc, not found some examples:
>> https://dlang.org/phobos/core_stdcpp_string.html
>>
>> look php doc, have it:
>> https://www.php.net/manual/en/mysqli.query.php
>
> I think D's policy is not to provide its own duplicated documentation for bindings to the C and C++ standard libraries. It might be a good idea to link to the <string> documentation on cppreference.com [1], though.
>
> The D docs *should* provide an example for how to default-construct a C++ basic_string, since the D API in that case is different from the C++ version.
>
> [1] https://en.cppreference.com/w/cpp/header/string

I think .. all standard libraries and runtimes should have corresponding sample code.