COIN-OR::LEMON - Graph Library

Changeset 1211:a278d16bd2d0 in lemon-main


Ignore:
Timestamp:
07/29/20 14:56:10 (4 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Tags:
tip
Message:

Fix clang compilation issue (#634)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/maps.h

    r1092 r1211  
    5050      /// Returns the value associated with the given key.
    5151      Value operator[](const Key &) const {
    52         return *(static_cast<Value *>(0)+1);
     52        // return *(static_cast<Value *>(0));
     53        // return *(static_cast<Value *>(0)+1);
     54        // return *(static_cast<Value *>(sizeof(Value)));
     55        // return *(reinterpret_cast<Value *>(0));
     56        // return *(reinterpret_cast<Value *>(0)+1);
     57        return *(reinterpret_cast<Value *>(sizeof(Value)));
    5358      }
    5459
     
    132137      /// Returns the value associated with the given key.
    133138      Value operator[](const Key &) const {
    134         Value *r = 0;
    135         return *r;
     139        return *(reinterpret_cast<Value *>(sizeof(Value)));
    136140      }
    137141
     
    173177      /// Returns a reference to the value associated with the given key.
    174178      Reference operator[](const Key &) {
    175         Value *r = 0;
    176         return *r;
     179        return *(reinterpret_cast<Value *>(sizeof(Value)));
    177180      }
    178181
    179182      /// Returns a const reference to the value associated with the given key.
    180183      ConstReference operator[](const Key &) const {
    181         Value *r = 0;
    182         return *r;
     184        return *(reinterpret_cast<Value *>(sizeof(Value)));
    183185      }
    184186
Note: See TracChangeset for help on using the changeset viewer.