Thread overview
Is there a way to make a struct without a distinction between constant, immutable, and mutable?
Nov 18, 2024
Liam McGillivray
Nov 19, 2024
Salih Dincer
November 18, 2024

I am doing work on the units-d library. This library contains some struct templates which don't contain any variables. Because of this, all instances are effectively constant. However, when they are placed as arguments in other templates, it causes problems when one is unexpectedly const.

Is there a way to make it so that this struct has only one qualifier? No distinction?

November 19, 2024

On Monday, 18 November 2024 at 23:43:46 UTC, Liam McGillivray wrote:

>

I am doing work on the units-d library. This library contains some struct templates which don't contain any variables. Because of this, all instances are effectively constant. However, when they are placed as arguments in other templates, it causes problems when one is unexpectedly const.

Is there a way to make it so that this struct has only one qualifier? No distinction?

Hqve you try the module here:

https://github.com/atilaneves/unit-threaded

SDB@79

November 20, 2024

On Monday, 18 November 2024 at 23:43:46 UTC, Liam McGillivray wrote:

>

Is there a way to make it so that this struct has only one qualifier? No distinction?

Can you give an example of a problem and list the error messages?

-Steve