Is there a way to get Tuple (and Typedef) from the std.typecons
module to generate a new type that is unique on every
instantiation? What I mean is:
alias T1 = Tuple!(int, int);
alias T2 = Tuple!(int, int);
writeln(__traits(isSame, T1, T2)); // prints true
When using Typedef, the types are
On Sun, 11 Jan 2015 11:41:08 +
Martin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Is there a way to get Tuple (and Typedef) from the std.typecons
module to generate a new type that is unique on every
instantiation? What I mean is:
alias T1 = Tuple!(int, int);
alias
I use this Typedef implementation instead:
/// one with non-default initializer
template Typedef(T, istring name, T initval)
{
static assert (name.length, Can't create Typedef with an
empty identifier);
enum Typedef =
(struct ~ name ~
{ ~
On Sunday, 11 January 2015 at 11:52:42 UTC, ketmar via
Digitalmars-d-learn wrote:
On Sun, 11 Jan 2015 11:41:08 +
Martin via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
Is there a way to get Tuple (and Typedef) from the std.typecons
module to generate a new type that is
On Sun, 11 Jan 2015 12:00:19 +
Martin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
as for `Typedef!` -- you can use it's third arg, cookie:
import std.typecons;
alias T1 = Tuple!(int, int);
alias T2 = Tuple!(int, int);
alias T1New = Typedef!(T1,
I am trying to understand how to use C++ lib from D.
For my App I need http://www.gdal.org
I had read about using C++ libs from D, and understood that there
is 2 ways:
1. Make binding - convert .H to .d (I still do not fully
understand what is it)
2. Use directly C++ lib (.dll)
I decided to
Can someone please tell me what I'm doing wrong here, the sql
INSERT statement fails for some reason. I don't fully understand
the callback function yet (I borrowed this from a C tutorial on
the subject), maybe that is the source of the problem?
import etc.c.sqlite3;
import std.stdio;
On Monday, 11 June 2012 at 19:52:38 UTC, bearophile wrote:
Using that the code is:
import std.string, std.stdio, std.array;
void main() {
auto words = foo bar doo.split();
auto res = permutations!false(words).map!(p = p.join(
))().array();
writeln(res);
}
Is doCopy really needed
Nordlöw:
Is doCopy really needed as an argument here?
Couldn't this be inferred from the mutability of T instead?
doCopy is useful, if it's true all the permutation arrays are
distinct and dup-ped, otherwise they are all different. It's true
by default, so casual users of that generator
On Sun, 11 Jan 2015 20:00:03 +
Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Can someone please tell me what I'm doing wrong here, the sql
INSERT statement fails for some reason. I don't fully understand
the callback function yet (I borrowed this from a C tutorial
On Sunday, 11 January 2015 at 20:20:21 UTC, ketmar via
Digitalmars-d-learn wrote:
note the single quotes in your code: that is where it all goes
wrong. i
don't know where you got that quotes from, but this is not a
valid SQL
syntax for `CREATE TABLE`. ;-)
Thank you, I thought it might be
On Sunday, 11 January 2015 at 18:01:09 UTC, bearophile wrote:
Nordlöw:
Is doCopy really needed as an argument here?
Couldn't this be inferred from the mutability of T instead?
doCopy is useful, if it's true all the permutation arrays are
distinct and dup-ped, otherwise they are all
On Sunday, 11 January 2015 at 18:01:09 UTC, bearophile wrote:
Is doCopy really needed as an argument here?
Couldn't this be inferred from the mutability of T instead?
doCopy is useful, if it's true all the permutation arrays are
distinct and dup-ped, otherwise they are all different. It's
Nordlöw:
Couldn't we do a first pass and check that if elements of T are
distinct and if so set doCopy to false otherwise true?
The algorithm you have seen in Rosettacode doesn't care if and
what items of the input sequence are duplicated, it handles them
as they are all distinct. And them
On Sunday, 11 January 2015 at 20:30:41 UTC, Paul wrote:
On Sunday, 11 January 2015 at 20:20:21 UTC, ketmar via
Digitalmars-d-learn wrote:
note the single quotes in your code: that is where it all goes
wrong. i
don't know where you got that quotes from, but this is not a
valid SQL
syntax for
On Sunday, 11 January 2015 at 12:56:40 UTC, Suliman wrote:
I had read about using C++ libs from D, and understood that
there is 2 ways:
1. Make binding - convert .H to .d (I still do not fully
understand what is it)
2. Use directly C++ lib (.dll)
No, there are not two ways. There is one
On Sunday, 11 January 2015 at 22:19:28 UTC, Tobias Pankrath wrote:
Hint: Put the SQL in a file create_people.sql and import it
into your code via the import statement:
string sql = import(create_people.sql); // you'll need a
correct -J compiler switch
That way you can easily test if it's
On Saturday, 10 January 2015 at 23:32:47 UTC, bearophile wrote:
Laeeth Isharc:
In D there is a feature that allows a function to accept both
an array of items and items,
yes - it is funny there is not an overloading that accepts
arrays
I meant this D feature:
void foo(T)(T[] items...) {
18 matches
Mail list logo