On Monday, 12 April 2021 at 13:14:27 UTC, Kagamin wrote:
class foo {
this ( foo p /* , other params */ ) {
parent = p;
}
foo create() {
return new foo(this);
}
void use() {
foo f = create();
}
Hi,
I have a class with a reference to the parent object and a
constructor that has the parent as parameter
class foo {
this ( foo p /* , other params */ ) {
parent = p;
}
foo parent;
}
Of cause, the parent is almost always the object that creates the
On Wednesday, 7 March 2018 at 13:26:06 UTC, Alex wrote:
From this point of view, size_t is not fixed, but capable to
point to any place in memory.
Therefore, pointer of any type have by definition exactly the
defined size of size_t.
Thank you,I thougth that pointer aliasing wasn't allowed.
Hi all,
I would like to use bt function (core.bitop) on generic array but
it seems that's not possible. I would like to know if there is
some reasons to have a fixed type (size_t) instead of something
like :
pure @system int bt(T)(in T* p,size_t bitnum)
if(__traits(isIntegral,T))
{
re
Is it possible to get the list of usages of a template during
compile time?
For example:
class Foo
{
void bar(T)(T t)
{
}
}
void main()
{
Foo foo = new Foo;
foo.bar(1); // int
foo.bar(2f); // float
foo.bar("3"); // string
}
// pragma(ms
Thank you i will try it.
Hi,
I would like to know how can i access private member of class
from outside ?
I think about serialization for instance, serializer must have
access to protected attributes. How this is done ?
Thank you.
On Saturday, 21 November 2015 at 01:18:38 UTC, Charles wrote:
What string is throwing the error? I've had that error when I
was trying to decode windows1252 strings.
Thank you for your answer, but it's not a compilation error, it's
a message box displayed when i lauch compilation. I asked some
Hello, I can't build my project with MS-COFF option.
I'm using DMD 2.069.
I got this error :
utf.d(1109) : invalid UTF-8 sequence (at index 1)
I used these options with visual D:
Compiler : DMD
D-Version : D2
Output Type: DLL
Subsystem : Not set
Compilation: Combined co
On Sunday, 20 September 2015 at 09:34:15 UTC, Ali Çehreli wrote:
On 09/20/2015 12:47 AM, Pierre wrote:
I see, maybe .KeyType and .ValueType should be integrated in
AA.
Or like C++ with map, make a ValueType(::value_type) field
wich contain
a pair of type.
Currently, they are templates in st
On Saturday, 19 September 2015 at 18:13:09 UTC, Marc Schütz wrote:
On Saturday, 19 September 2015 at 12:50:51 UTC, Pierre wrote:
Hi everybody,
I would like to extract key and value type from AA.
You can also do it with built-in syntax:
template AATypes(AA : K[V], K, V)
{
alias Key = K;
On Saturday, 19 September 2015 at 12:52:19 UTC, ponce wrote:
On Saturday, 19 September 2015 at 12:50:51 UTC, Pierre wrote:
So how can I get types without instance ?
Thanks for help.
-->8-
template AATypes(T)
{
// todo: static assert if T is no AA type here
alias ArrayElem
Hi everybody,
I would like to extract key and value type from AA.
I found this answer on forum :
template AATypes(T)
{
// todo: static assert if T is no AA type here
alias ArrayElementType!(typeof(T.keys)) key;
alias ArrayElementType!(typeof(T.values)) value;
}
But compiler failed,I thi
OK that's very clear thank you for the answer.
I made a mistake it's more like:
//Sample class
class CClass
{
this(string MyValue){...}
}
//Called function
void MyFunction(CClass MyClass){}
void main()
{
MyFunction("Hello World!"); //Failed : MyFunction not
callable...
}
Hi everybody,
I would like to use implicit conversion like this:
//Sample class
class MyClass
{
this(string MyValue){...}
}
//Called function
void MyFunction(Foo MyFoo){}
void main()
{
MyFunction("Hello World!"); //Failed : MyFunction not
callable...
}
I saw in forum this is OK because
On Thursday, 26 March 2015 at 04:57:55 UTC, ketmar wrote:
On Tue, 24 Mar 2015 16:49:01 +, Nicolas Sicard wrote:
I don't know if this is a bug or expected behaviour. The
struct is
mutable, assignable and pre-increment operator works. But
post-increment
doesn't compile because of the immuta
On Thursday, 26 March 2015 at 04:52:23 UTC, Belly wrote:
Hello, just installed D today. I have this code:
import std.stdio;
import win32.windef;
import win32.winbase;
void main()
{
LPSTR lpBuffer;
PDWORD lpnSize;
int result = GetComputerNameA(lpBuffer, lpnSize);
writeln(result)
18 matches
Mail list logo