Hi,
I try to get wrap the "Azure SDK for C" using DPP and have
following issue.
Functions, which are actually implemented in C header files will
cause
linker errors:
https://github.com/Azure/azure-sdk-for-c/blob/master/sdk/core/core/inc/az_span.h#L91
Example:
AZ_NODISCARD AZ_INLINE az_span a
On Monday, 17 February 2020 at 22:34:31 UTC, Stefan Koch wrote:
Upon seeing this I just implemented typeid(stuff).name;
https://github.com/dlang/dmd/pull/10796
With any luck this will be possible in the next release ;)
Can this work using `stuff.classinfo.name` too ?
This is the same as `typ
On Monday, 17 February 2020 at 18:49:55 UTC, Steven Schveighoffer
wrote:
On 2/17/20 2:28 AM, Nathan S. wrote:
What I want is something like this:
string className(in Object obj) {
return obj is null ? "null" : typeid(obj).name;
}
...except I want it to work in CTFE. What is the
On Monday, 17 February 2020 at 20:08:24 UTC, Adnan wrote:
On Monday, 17 February 2020 at 14:34:44 UTC, Simen Kjærås wrote:
On Monday, 17 February 2020 at 14:04:34 UTC, Adnan wrote:
//
All in all, I end up with this code:
module strassens_matmul
package {
T[][] mulIterative(T)(const T[][]
On Monday, 17 February 2020 at 14:34:44 UTC, Simen Kjærås wrote:
On Monday, 17 February 2020 at 14:04:34 UTC, Adnan wrote:
//
All in all, I end up with this code:
module strassens_matmul
package {
T[][] mulIterative(T)(const T[][] mat1, const T[][] mat2) {
auto result = createMatr
On Monday, 17 February 2020 at 11:51:03 UTC, Abby wrote:
On Monday, 17 February 2020 at 11:05:46 UTC, Stefan Koch wrote:
On Monday, 17 February 2020 at 10:18:32 UTC, Abby wrote:
[...]
I have a ctfe compatible string formatter, you should be to
find it here
https://forum.dlang.org/post/hmyxv
On 2/17/20 2:28 AM, Nathan S. wrote:
What I want is something like this:
string className(in Object obj) {
return obj is null ? "null" : typeid(obj).name;
}
...except I want it to work in CTFE. What is the way to do this in D?
https://issues.dlang.org/show_bug.cgi?id=7147
It's
On 2/16/20 9:01 AM, Robert M. Münch wrote:
I want to use a specific branch version if a package. I specified the
branch version in a dub.selections.json file.
But it seems that dub requires a ZIP file that can be downloaded from
code.dlang.org, which of course fails because the branch is only
> Either way, generic code should never be using a range after
> it's been copied, and copying is a key part of how
> idiomatic, range-based code works in D.
OK. Thanks for instructions. I shall give it a try.
On Monday, 17 February 2020 at 17:01:12 UTC, Adam D. Ruppe wrote:
It sometimes helps to write it out log-form
foo.opDispatch!"hello"(5);
should give the full error.
this btw is one of the most annoying missing errors in d...
This worked, thank you!
On Monday, 17 February 2020 at 16:45:53 U
On Monday, 17 February 2020 at 16:41:54 UTC, cc wrote:
Foo foo;
foo.hello(5);
Result: Error: no property `hello` for type `Foo`
It sometimes helps to write it out log-form
foo.opDispatch!"hello"(5);
should give the full error.
this btw is one of the most annoying missing errors in d...
On 2/17/20 8:41 AM, cc wrote:
Is there any way to see the compilation errors that occurred within an
opDispatch template?
struct Foo {
void opDispatch(string s, SA...)(SA sargs) {
literally anything;
}
}
Foo foo;
foo.hello(5);
Result: Error: no property `hello` for type `Fo
Is there any way to see the compilation errors that occurred
within an opDispatch template?
struct Foo {
void opDispatch(string s, SA...)(SA sargs) {
literally anything;
}
}
Foo foo;
foo.hello(5);
Result: Error: no property `hello` for type `Foo`
Desired result
On Monday, 17 February 2020 at 14:04:34 UTC, Adnan wrote:
cdsa ~master: building configuration "cdsa-test-library"...
source/strassens_matmul.d(22,16): Error: cannot implicitly
convert expression &mat[row][column] of type const(uint)* to
uint*
source/strassens_matmul.d(37,36): Error: template i
On Monday, 17 February 2020 at 14:04:34 UTC, Adnan wrote:
On Monday, 17 February 2020 at 13:44:55 UTC, Adnan wrote:
[...]
Okay I changed to
module strassens_matmul;
[...]
I changed getPointPtr to following and now it works
/// row and column are 0 index-based
void assign(T)(ref T[]
On Monday, 17 February 2020 at 13:44:55 UTC, Adnan wrote:
https://ideone.com/lVi5Uy
module strassens_matmul;
debug {
static import std;
}
...
Okay I changed to
module strassens_matmul;
debug {
static import std;
}
package {
ulong getRowSize(T)(scope const T[][] mat) {
re
On Monday, 17 February 2020 at 13:03:38 UTC, Basile B. wrote:
eg
Sh(echo) < "meh";
struct Sh
{
// you see the idea we have op overload for < here
}
You can't overload < separately - all the comparison operators
(<, <=, >, >=) are handled via opCmp. Even if you choose to go
down that
https://ideone.com/lVi5Uy
module strassens_matmul;
debug {
static import std;
}
package {
ulong getRowSize(T)(T[][] mat) {
return mat[0].length;
}
ulong getColumnSize(T)(T[][] mat) {
return mat.length;
}
T[][] createMatrix(T)(const ulong rowSize, const
On Monday, 17 February 2020 at 13:03:38 UTC, Basile B. wrote:
Sh(echo) < "meh";
Not allowed in D - it only does a comparison overload which
covers < and > (and <= and >=).
Though we could do strings and stuff. especially with my string
interpolation dip
https://gist.github.com/adamdrupp
On Monday, 17 February 2020 at 12:11:38 UTC, Simen Kjærås wrote:
On Monday, 17 February 2020 at 11:51:52 UTC, FeepingCreature
wrote:
[...]
One tiny thing: the above fails for tuples with named fields,
like Tuple!(int, "a", string "b"). This code handles that case,
and preserves field names:
eg
Sh(echo) < "meh";
struct Sh
{
// you see the idea we have op overload for < here
}
On Monday, 17 February 2020 at 11:51:52 UTC, FeepingCreature
wrote:
Here you go:
import std;
// extract the types that make up the tuple
auto transposeTuple(T : Tuple!Types[], Types...)(T tuples)
{
// templated function that extracts the ith field of an
array of tuples as an array
aut
On Monday, 17 February 2020 at 11:07:33 UTC, foozzer wrote:
Hi all,
There's something in Phobos for that?
Thank you
Here you go:
import std;
// extract the types that make up the tuple
auto transposeTuple(T : Tuple!Types[], Types...)(T tuples)
{
// templated function that extracts the i
On Monday, 17 February 2020 at 11:51:52 UTC, FeepingCreature
wrote:
On Monday, 17 February 2020 at 11:07:33 UTC, foozzer wrote:
Hi all,
There's something in Phobos for that?
Thank you
Here you go:
import std;
// extract the types that make up the tuple
auto transposeTuple(T : Tuple!Types[]
On Monday, 17 February 2020 at 11:05:46 UTC, Stefan Koch wrote:
On Monday, 17 February 2020 at 10:18:32 UTC, Abby wrote:
Hi there guys,
I was trying to generated code during compile time. Bassicly
I'm creating a tokenizer and I would like to generated nested
switch using betterC.
[...]
I h
On Monday, 17 February 2020 at 11:07:33 UTC, foozzer wrote:
Hi all,
There's something in Phobos for that?
Thank you
import std.meta : staticMap;
import std.typecons : Tuple;
// Turn types into arrays
alias ToArray(T) = T[];
// Leave everything else the same
alias ToArray(T...) = T;
// Now ap
Hi all,
There's something in Phobos for that?
Thank you
On Monday, 17 February 2020 at 10:18:32 UTC, Abby wrote:
Hi there guys,
I was trying to generated code during compile time. Bassicly
I'm creating a tokenizer and I would like to generated nested
switch using betterC.
[...]
I have a ctfe compatible string formatter, you should be to find
it
Hi there guys,
I was trying to generated code during compile time. Bassicly I'm
creating a tokenizer and I would like to generated nested switch
using betterC.
Basically convert something like this:
enum tokens =
[
['!', '='],
['>', '='],
['>'],
];
to:
switch(str[i])
{
case
On Monday, 17 February 2020 at 09:41:35 UTC, Adnan wrote:
On Monday, 17 February 2020 at 07:50:02 UTC, Mitacha wrote:
On Monday, 17 February 2020 at 05:04:02 UTC, Adnan wrote:
What is the equivalent of Rust's chunks_exact()[1] method in
D? I want to iterate over a spitted string two chunks at a
On Monday, 17 February 2020 at 07:50:02 UTC, Mitacha wrote:
On Monday, 17 February 2020 at 05:04:02 UTC, Adnan wrote:
What is the equivalent of Rust's chunks_exact()[1] method in
D? I want to iterate over a spitted string two chunks at a
time.
[1]
https://doc.rust-lang.org/beta/std/primitiv
When I start a new project is there anything that I should get
right from the start? Like using a specific set of compiler flags
(e.g. -dip1000)?
Is there an overview over the status of upcoming language changes
(-preview=?), e.g. what about -preview=rvaluerefparam? Should I
use it?
32 matches
Mail list logo