On Wednesday, 8 July 2020 at 20:11:05 UTC, IGotD- wrote:
int v;
enum sz = mySize!int // works, returns 46
enum sz2 = mySize(v) // doesn't work. Error: variable v cannot
be read at compile time
Here we have a difference between C++ and D as C++ was able
infer the size of v during compile tim
On Wednesday, 8 July 2020 at 20:11:05 UTC, IGotD- wrote:
Now since mySize is a template, shouldn't this work mySize!v,
but it doesn't? What essential understanding have I missed here?
You are trying to use a run-time value of v at compile-time,
which is not possible. If you want the modifie
On Wednesday, 8 July 2020 at 19:48:07 UTC, Quantium wrote:
I'm learning now memory usage in D, and I have the problem that
I can't solve.
The problem is (The third step):
1) Programm gets number (In int format) as input data.
2) Integer is converted to HEX
3) Programm gets the data in 0x
memory
On Wed, Jul 08, 2020 at 08:11:05PM +, IGotD- via Digitalmars-d-learn wrote:
[...]
> Doing the same in D, would with my lack of knowledge look like this.
>
>
> size_t mySize(T)()
> {
> return T.sizeof + 42;
> }
What you want is:
enum mySize(T) = T.sizeof + 42;
And there is no ne
I have the following functions in C++
template
inline constexpr size_t mySize(const T &v)
{
return sizeof(v) + 42;
}
template
inline constexpr size_t mySize()
{
return sizeof(T) + 42;
}
The constexpr ensures that it will be calculated to a compile
time constant otherwise the build wil
I'm learning now memory usage in D, and I have the problem that I
can't solve.
The problem is (The third step):
1) Programm gets number (In int format) as input data.
2) Integer is converted to HEX
3) Programm gets the data in 0x memory
slot and writes it in the console.
On Wednesday, 8 July 2020 at 15:55:58 UTC, Mitacha wrote:
Hello there,
I've been trying to setup bitbucket pipelines to submit
coverage to codecov, but with no luck.
I use `dub run -b unittest-cov` and it generates .lst files
correctly, then `bash <(curl -s https://codecov.io/bash) -t
$CODECO
Hello there,
I've been trying to setup bitbucket pipelines to submit coverage
to codecov, but with no luck.
I use `dub run -b unittest-cov` and it generates .lst files
correctly, then `bash <(curl -s https://codecov.io/bash) -t
$CODECOV_TOKEN` is called, but all I get is:
```
==> Bitbucket d
On 7/8/20 9:38 AM, ag0aep6g wrote:
On 08.07.20 14:24, Steven Schveighoffer wrote:
I solved it for now by extrapolating the inner code into a local
template function. But this is definitely an awkward situation for
static foreach.
FWIW, you can write the extra function like this:
static
On 08.07.20 14:24, Steven Schveighoffer wrote:
I solved it for now by extrapolating the inner code into a local
template function. But this is definitely an awkward situation for
static foreach.
FWIW, you can write the extra function like this:
static foreach (T; Types)
() {
i
On 7/8/20 6:13 AM, Stanislav Blinov wrote:
On Wednesday, 8 July 2020 at 02:06:01 UTC, Steven Schveighoffer wrote:
Seems simple enough, except that this inner portion is unrolled, and
if I have more than one type to run this on, I already have an
"innerloop" label defined.
Is there a way to d
On 7/8/20 5:10 AM, cc wrote:
I think I ran into similar problems due to the requirement to use a
labeled break inside static foreach. I got around it by defining enums
when my target was found and checking if it existed via
__traits(compiles) to "ignore" the rest of the loop.
Thanks for th
On Wednesday, 8 July 2020 at 02:06:01 UTC, Steven Schveighoffer
wrote:
Seems simple enough, except that this inner portion is
unrolled, and if I have more than one type to run this on, I
already have an "innerloop" label defined.
Is there a way to define a label using a mixin or something? o
On Wednesday, 8 July 2020 at 02:06:01 UTC, Steven Schveighoffer
wrote:
OK, so I have a situation where I'm foreaching over a
compile-time list of types. Inside the loop, I'm using a second
loop over a set of input.
Inside that loop, I'm using a switch on the input, and inside
the switch, I'm
I'm looking for a way to configure applications and libraries.
I'm imagining a way for libraries to hook into a single point to
provide the configuration parameters the library provides. These
parameters can then be changed in one location from the user of
the libraries (usually an application)
15 matches
Mail list logo