I've tested your code on the source code itself and it works as
expected:
```
» ./salih2 < salih2.d
import std;
struct StdinByChar
{
@property bool empty()
{
if(isEmpty)
return true;
if(!hasChar)
{
auto buff = new char[1];
stdin.rawRead(buff);
if (buff[0] == 0x7E) // tilde (
Range is empty!
```