Date: Tue, 4 Feb 2025 14:36:02 +0000
You would never be able to define the mangled name in this way, because of ODR, which must not be violated.
The point is not to break how different implantations mangle names, and breaking compatibility.
I don't think you should be messing with compilers in this way.
The point is to make it easier to compile code and forward declare things without knowing the full details, and delegate to the linker to figure out the complicated details of what is the actual type name.
________________________________
From: Std-Proposals <std-proposals-bounces_at_lists.isocpp.org> on behalf of Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]>
Sent: Tuesday, February 4, 2025 2:24:13 PM
To: std-proposals_at_lists.isocpp.org <std-proposals_at_[hidden]>
Cc: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Subject: Re: [std-proposals] Specify the mangled name
On Tue, Feb 4, 2025 at 12:23 PM Tiago Freire <tmiguelf_at_[hidden]> wrote:
>
> typename MyType;
I like the use of the keyword 'typename' instead of 'declare' for
this. So you can use it for standard library classes (and template
classes) as follows:
typename std::runtime_error;
extern bool IsFatal(std::runtime_error &);
constexpr bool all_are_fatal = false;
bool Process(std::runtime_error &arg)
{
return all_are_fatal || IsFatal(arg);
}
In the future, perhaps the use of the typename keyword could be
extended, perhaps even to specify the mangled name of the type:
typename SomeType "_Z8SomeType";
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
The point is not to break how different implantations mangle names, and breaking compatibility.
I don't think you should be messing with compilers in this way.
The point is to make it easier to compile code and forward declare things without knowing the full details, and delegate to the linker to figure out the complicated details of what is the actual type name.
________________________________
From: Std-Proposals <std-proposals-bounces_at_lists.isocpp.org> on behalf of Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]>
Sent: Tuesday, February 4, 2025 2:24:13 PM
To: std-proposals_at_lists.isocpp.org <std-proposals_at_[hidden]>
Cc: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Subject: Re: [std-proposals] Specify the mangled name
On Tue, Feb 4, 2025 at 12:23 PM Tiago Freire <tmiguelf_at_[hidden]> wrote:
>
> typename MyType;
I like the use of the keyword 'typename' instead of 'declare' for
this. So you can use it for standard library classes (and template
classes) as follows:
typename std::runtime_error;
extern bool IsFatal(std::runtime_error &);
constexpr bool all_are_fatal = false;
bool Process(std::runtime_error &arg)
{
return all_are_fatal || IsFatal(arg);
}
In the future, perhaps the use of the typename keyword could be
extended, perhaps even to specify the mangled name of the type:
typename SomeType "_Z8SomeType";
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-02-04 14:36:06