On Wednesday, 4 January 2023 at 04:42:08 UTC, Ali Çehreli wrote:
On 1/3/23 20:11, thebluepandabear wrote:
> if I replace the `isDrawable` template with the
> following (using `typeof`), the code does not compile:
It must be because T is already a type. It's the same reason
why the following
On 1/3/23 20:11, thebluepandabear wrote:
> if I replace the `isDrawable` template with the
> following (using `typeof`), the code does not compile:
It must be because T is already a type. It's the same reason why the
following code fails to compile:
void main() {
alias T = int;
alias
On 1/3/23 19:42, thebluepandabear wrote:
> @property {
As your post proves, that feature is at most half-baked and is
discouraged. Today, there is just one known obscure effect of using it.
> void name(string name) {
> _name = name;
> }
> d.name =
I am using the CSFML D bindings, and I am creating my own `draw`
template function.
I first check that the object passed in is of the appropriate
type, and if it is, I call the appropriate function:
```D
template isDrawable(T) {
enum isDrawable = is(T == sfCircleShape*) || is(T ==
matheus, using dmd64 on my laptop to compile and run this:
```d
import std.stdio, std.traits;
class MyClass {char[16] c;}
void main() {
writeln(" Size Alignment Type\n",
"=");
size_t size = __traits(classInstanceSize, MyClass);
size_t alignment
Say you have the following class which represents a dog :
```D
class Dog {
@property {
string name();
void name(string name) {
_name = name;
}
}
private {
string _name;
}
}
```
And you have the following code with constructs a `Dog`
On Tuesday, 3 January 2023 at 21:13:55 UTC, Sergey wrote:
On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote:
I’ve read this [series if
articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-part-1-introduction) about using Excel Solver for all kinds
On Sunday, 1 January 2023 at 22:00:29 UTC, max haughton wrote:
On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote:
I’ve read this [series if
articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-part-1-introduction) about using Excel Solver for all
On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote:
I’ve read this [series if
articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-part-1-introduction) about using Excel Solver for all kinds of optimization problems. This is very neat, but of course,
On Tuesday, 3 January 2023 at 07:41:46 UTC, Salih Dincer wrote:
P.S. Actually the code works when we don't use enum.
My mistake, I forgot that enum cannot be inferred!
Very very sorry, suppose I didn't intervene Also this has
worked:
```d
void main() {
template Fun(Key, Value)
{
10 matches
Mail list logo