digitalmars.D.learn - How to use template Object in interface?
- zoujiaqing (13/13) Jun 25 2019 hunt-cache current version use template implemention adapter
- zoujiaqing (19/32) Jun 25 2019 Interface code:
- zoujiaqing (3/16) Jun 26 2019 Error in this commit:
hunt-cache current version use template implemention adapter changes. I want use Interface to define Adapter, this master code unable to comple. How to do it? D programming language design flaws? ```bash git clone https://github.com/huntlabs/hunt-cache cd hunt-cache/example dub run -v ... source/app.d(29,19): Error: no property name for type Nullable!(User) ```
Jun 25 2019
On Tuesday, 25 June 2019 at 12:11:47 UTC, zoujiaqing wrote:hunt-cache current version use template implemention adapter changes. I want use Interface to define Adapter, this master code unable to comple. How to do it? D programming language design flaws? ```bash git clone https://github.com/huntlabs/hunt-cache cd hunt-cache/example dub run -v ... source/app.d(29,19): Error: no property name for type Nullable!(User) ```Interface code: https://github.com/huntlabs/hunt-cache/blob/master/source/hunt/cache/adapter/Adapter.d ```D module hunt.cache.adapter.Adapter; import hunt.cache.Nullable; interface Adapter { Nullable!V get(V) (string key); Nullable!V[string] get(V) (string[] keys); void set(V) (string key, V value, uint expired); void set(V) (V[string] maps, uint expired); bool setIfAbsent(V) (string key, V value); bool hasKey(string key); bool remove(string key); void remove(string[] keys); void clear(); } ```
Jun 25 2019
On Tuesday, 25 June 2019 at 12:11:47 UTC, zoujiaqing wrote:hunt-cache current version use template implemention adapter changes. I want use Interface to define Adapter, this master code unable to comple. How to do it? D programming language design flaws? ```bash git clone https://github.com/huntlabs/hunt-cache cd hunt-cache/example dub run -v ... source/app.d(29,19): Error: no property name for type Nullable!(User) ```Error in this commit: https://github.com/huntlabs/hunt-cache/commit/1f4ca85b47a7e62b41907152f8c8904e69a09975
Jun 26 2019