So what exactly is coming with extended C++ support?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 14 16:01:50 PDT 2014


On 10/14/14, 3:53 PM, Meta wrote:
> On Tuesday, 14 October 2014 at 22:27:35 UTC, Walter Bright wrote:
>> Currently, D supports C++:
>>
>> * function calling
>> * name mangling
>> * namespaces
>> * templates
>> * member functions
>> * single inheritance
>> * basic types that exist in C++ but not D (like 'long')
>>
>> Note that there are no plans to support C++ semantics - the D side
>> will support only D semantic rules. SFINAE, Koenig lookup, etc., have
>> no place in D.
>>
>> C++ interop will require the user to be flexible on both the C++ and D
>> side, and bluntly will require strong knowledge of D and C++ and how
>> they work under the hood to be successful with it.
>>
>> Probably the most tricky thing we're working on is interop with C++
>> exceptions.
>>
>> Essentially, we're going to see how far we can push interop.
>
> To clarify, templates have to be instantiated on the C++ side before
> being passed to D, right? Is it correct that D can't instantiate a C++
> template?

Correct. Here's the syntax on the C++ side: 
http://en.wikipedia.org/wiki/C++11#Extern_template -- Andrei


More information about the Digitalmars-d mailing list