Re: How to check if object is an instance of generic class?

2017-05-03 Thread Nothing via Digitalmars-d-learn
On Wednesday, 3 May 2017 at 17:54:13 UTC, H. S. Teoh wrote: On Wed, May 03, 2017 at 05:26:27PM +, Nothing via Digitalmars-d-learn wrote: Hi, Honestly I am new to D and templates system so excuse me But of course, if you wish to write your own Box type, then to answer your question

How to check if object is an instance of generic class?

2017-05-03 Thread Nothing via Digitalmars-d-learn
Hi, Honestly I am new to D and templates system so excuse me if my question will seem trivial. I want to develop a generic Box(T) class that can be either empty or hold a value of arbitrary type T. // class Box(T) { override bool opEquals(Object o) { //...