# HG changeset patch # User Alpar Juttner # Date 1596027370 -7200 # Node ID a278d16bd2d082aa3c52ff4a9b0e2224ddc0549a # Parent da87dbdf3daf3022d0b43a237ce64d84d8a96e47 Fix clang compilation issue (#634) diff -r da87dbdf3daf -r a278d16bd2d0 lemon/concepts/maps.h --- a/lemon/concepts/maps.h Tue Jul 28 21:23:36 2020 +0200 +++ b/lemon/concepts/maps.h Wed Jul 29 14:56:10 2020 +0200 @@ -49,7 +49,12 @@ /// Returns the value associated with the given key. Value operator[](const Key &) const { - return *(static_cast(0)+1); + // return *(static_cast(0)); + // return *(static_cast(0)+1); + // return *(static_cast(sizeof(Value))); + // return *(reinterpret_cast(0)); + // return *(reinterpret_cast(0)+1); + return *(reinterpret_cast(sizeof(Value))); } template @@ -131,8 +136,7 @@ /// Returns the value associated with the given key. Value operator[](const Key &) const { - Value *r = 0; - return *r; + return *(reinterpret_cast(sizeof(Value))); } /// Sets the value associated with the given key. @@ -172,14 +176,12 @@ /// Returns a reference to the value associated with the given key. Reference operator[](const Key &) { - Value *r = 0; - return *r; + return *(reinterpret_cast(sizeof(Value))); } /// Returns a const reference to the value associated with the given key. ConstReference operator[](const Key &) const { - Value *r = 0; - return *r; + return *(reinterpret_cast(sizeof(Value))); } /// Sets the value associated with the given key.