Re: Passing to c++ std::string and vector

2018-04-30 Thread Seb via Digitalmars-d-learn
On Monday, 30 April 2018 at 01:07:35 UTC, NewUser wrote: Hi, How do I pass a d string to a c++ std::string? NewUser There's https://github.com/dlang/druntime/pull/1316 (an attempt at making C++ standard library)

Re: Passing to c++ std::string and vector

2018-04-30 Thread NewUser via Digitalmars-d-learn
On Monday, 30 April 2018 at 10:48:40 UTC, Jonathan M Davis wrote: On Monday, April 30, 2018 01:07:35 NewUser via Digitalmars-d-learn wrote: Hi, How do I pass a d string to a c++ std::string? The most straightforward way would be to create a C or C++ function which accepts const char* and

Re: Passing to c++ std::string and vector

2018-04-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 30, 2018 01:07:35 NewUser via Digitalmars-d-learn wrote: > Hi, > > How do I pass a d string to a c++ std::string? The most straightforward way would be to create a C or C++ function which accepts const char* and size_t and then creates the std::string, in which case you pass it

Re: Passing to c++ std::string and vector

2018-04-30 Thread Uknown via Digitalmars-d-learn
On Monday, 30 April 2018 at 01:07:35 UTC, NewUser wrote: Hi, How do I pass a d string to a c++ std::string? NewUser There is no trivial way to do this as far as I'm aware, mostly due to C++ mangling issues in DMD. You can try calypso [0] or dpp [1], which might work. You can also see this

Passing to c++ std::string and vector

2018-04-29 Thread NewUser via Digitalmars-d-learn
Hi, How do I pass a d string to a c++ std::string? NewUser