nedbrek Wrote:
2) What is the best way to make the same declarations work for D1 and D2?
It seems everything inside a version statement must parse correctly, and
D1 doesn't want to parse immutable(char)...
You may also use versioned aliases.
Just include the D2 code via a string mixin to
This example comes from http://digitalmars.com/d/2.0/template.html
int x;
template Foo(alias X)
{
static int* p = X;
}
void test()
{
alias Foo!(x) bar;
*bar.p = 3; // set x to 3
static int y;
alias Foo!(y) abc;
*abc.p = 3; // set y to 3
}
Compiling this
On 2011-03-16 22:41, Simen kjaeraas wrote:
On Wed, 16 Mar 2011 22:39:00 +0100, Denis Koroskin 2kor...@gmail.com
wrote:
On Thu, 17 Mar 2011 00:30:17 +0300, Jacob Carlborg d...@me.com wrote:
Is it possible to declare string literal of a template type,
something like this:
void bar (const(T)[]
I've tried using this:
auto file = File(file.cpp, r);
char[] replacement;
foreach (char[] line; file.byLine())
{
replacement = line.replace(regex(//.*), .);
// do something with replacement while its still alive..
}
This gives me this bombshell of an error:
simendsjo Wrote:
Are these pages written using DDoc? Is it possible to extract and compile the
examples to
ensure they are correct? And perhaps use asserts instead of/in addition to
comments where
possible (Asserts are used many places already)?
Executable and verifiable examples could be
Andrej Mitrovic Wrote:
char[] replacement;
foreach (char[] line; file.byLine())
{
replacement = line.replace(regex(-), .)
.replace(regex(::), .)
.replace(regex(//.*), )
You're right, that point totally slipped my mind. I'm having some
ideas about an alternative though. I'll try something out later.
Btw, shouldn't byLine be able to return a dchar[]? For Unicode purposes?
Why this works:
struct Test
{
int read()
{
return 5;
}
int[] readArray()
{
int[] readDim()
{
return [read(), read()];
}
return
A known bug http://d.puremagic.com/issues/show_bug.cgi?id=3159
Your just gonna have to make it a normal templated method
--
Aku MoD.
Andrej Mitrovic Wrote:
You're right, that point totally slipped my mind. I'm having some
ideas about an alternative though. I'll try something out later.
Btw, shouldn't byLine be able to return a dchar[]? For Unicode purposes?
Why, if you want to operate on a dchar[] instead of a dchar
Okie.
11 matches
Mail list logo