C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Specify the mangled name

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 4 Feb 2025 22:08:40 +0000
On Tue, Feb 4, 2025 at 8:54 PM Frederick Virchanza Gotham
<cauldwell.thomas_at_[hidden]> wrote:
>
> #include <fwd/std/vector>
> #include <fwd/std/deque>
> #include <fwd/std/list>


Another way to do it, in order to accommodate both 'old' and 'new'
compilers, would be to put a comment after the inclusion directive,
something like:

    #include <vector> // fwd[std::vector]

This will do what you need it to do on an old compiler, your code will
compile and link just fine.

On a new compiler, it will be more efficient, it will only bring in a
forward declaration for 'std::vector'.

Received on 2025-02-04 22:08:47