From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:1881:: with SMTP id 123-v6mr1770210ioy.8.1530752908229; Wed, 04 Jul 2018 18:08:28 -0700 (PDT) X-Received: by 2002:aca:c744:: with SMTP id x65-v6mr886834oif.2.1530752908011; Wed, 04 Jul 2018 18:08:28 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder4.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!u78-v6no2187457itb.0!news-out.google.com!z3-v6ni2216iti.0!nntp.google.com!d7-v6no2201445itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 4 Jul 2018 18:08:27 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=121.45.207.96; posting-account=d51RWwoAAADvR-x0zYAtT9z3CRxT1eXo NNTP-Posting-Host: 121.45.207.96 References: <85743ee2-7d33-4024-a497-73a8dae0f480@googlegroups.com> <3199b658-cc7d-47be-bc4d-a8346c0d765a@googlegroups.com> <6294202b-73d0-4c8c-af6f-e3435b4432c3@googlegroups.com> <4b11d923-8412-48bc-9406-d3aaaa81e6f2@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6e33e4c2-6972-4c61-9e26-171913d119d7@googlegroups.com> Subject: Re: Interface Ada string with C++ std::string From: Roger Injection-Date: Thu, 05 Jul 2018 01:08:28 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:53629 Date: 2018-07-04T18:08:27-07:00 List-Id: On Wednesday, July 4, 2018 at 9:52:35 PM UTC+10, Lucretia wrote: > The test_binding is the extreme way to do it. >=20 > The simpler, kind of, and preferred way would be to work out what you nee= d from the string class. Pass around the C++ pointer inside Ada. Then have = C functions which are imported to Ada which handle the messy C/C++ stuff, t= hen wrap those in Ada handling the Messy Ada/C stuff there. Thanks for all your advice. It turns out that my original effort was almost there and now works. As you advise, it just needs a C function between Ada and C++.