Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 886197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:01:50+00:00 2026-05-15T13:01:50+00:00

D easily interfaces with C . D just as easily interfaces with C++ ,

  • 0

D easily interfaces with C.

D just as easily interfaces with C++, but (and it’s a big but) the C++ needs to be extremely trivial. The code cannot use:

  • namespaces
  • templates
  • multiple inheritance
  • mix virtual with non-virtual methods
  • more?

I completely understand the inheritance restriction. The rest however, feel like artificial limitations. Now I don’t want to be able to use std::vector<T> directly, but I would really like to be able to link with std::vector<int> as an externed template.

The C++ interfacing page has this particularly depressing comment.

D templates have little in common with
C++ templates, and it is very unlikely
that any sort of reasonable method
could be found to express C++
templates in a link-compatible way
with D.

This means that the C++ STL, and C++
Boost, likely will never be accessible
from D.

Admittedly I’ll probably never need std::vector while coding in D, but I’d love to use QT or boost.

So what’s the deal. Why is it so hard to express non-trivial C++ classes in D? Would it not be worth it to add some special annotations or something to express at least namespaces?


Update:
“D has namespace support in the works” from Walter Bright.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:01:50+00:00Added an answer on May 15, 2026 at 1:01 pm

    FWIW Qt has an actively developed binding for D: http://www.dsource.org/projects/qtd

    I think many components in boost are too highly tied to C++ to be portable meaningfully to other languages.

    Using e.g. std::vector is possible if you spend the time on writing regular (e.g. namespace-level) functions that forward to the appropriate member functions. Tedious, but affordable (for higher-level components; probably not for std::vector).

    Also, I very recently checked in the standard library a sealed array and sealed binary heap implementation that use reference counting, malloc/free, and deterministic destruction instead of garbage collection (see http://www.dsource.org/projects/phobos/browser/trunk/phobos/std/container.d). Other containers will follow. These containers use three specific techniques (described in my upcoming article “Sealed Containers”) to achieve deterministic destruction without compromising program safety.

    Hopefully sealed containers will obviate any need to link with STL containers, even for tight applications that can’t afford garbage collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 501k
  • Answers 501k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In short: no. In long: For the most part, you… May 16, 2026 at 2:15 pm
  • Editorial Team
    Editorial Team added an answer I'd do it like this: :%s/\v(foo|bar)/\={'foo':'bar','bar':'foo'}[submatch(0)]/g But that's too much… May 16, 2026 at 2:15 pm
  • Editorial Team
    Editorial Team added an answer Use a FileStreamResult Action public FileStreamResult Export(int? ID) { MemoryStream… May 16, 2026 at 2:15 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

A big reason why I use OOP is to create code that is easily
We're doing some serious games interface work. Games allow unique new interfaces, but we
My whole application (which is rather big, with a 20MB executable) is written in
every time i code a gui (in my case with GWT, never touched gui
When organizing a project where should I put the provider interfaces which are used
I need to define simple classes and interfaces ( Ex. IClassInterface ) in a
This is a little contrived, but say I have a class interface like this:
I'm looking for a tool that allows me to easily manage duplicate entries in
How do you most easily calculate how many e.g. Mondays are left in a
I need to know how I can easily add another series to an existing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.