Index: metalic/ChangeLog from Giovanni Palma giovanni@lrde.epita.fr
* mlc/type.hh: Remove static cast.
Index: metalic/mlc/type.hh --- metalic/mlc/type.hh Mon, 09 Feb 2004 18:57:03 +0100 palma_g (oln/c/21_type.hh 1.28 640) +++ metalic/mlc/type.hh Thu, 01 Apr 2004 11:33:02 +0200 palma_g (oln/c/21_type.hh 1.28 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -70,7 +70,7 @@ private: // This stores the actual value of the offset between the this // pointer and the address of the exact type. This enables diamond - // shaped hierarchies (static_cast can't and reinterpret_cast or + // shaped hierarchies (static_cas can't and reinterpret_cast or // (Exact*)(void*) cast are unsafe and compiler dependent). static const int exact_offset;
@@ -105,8 +105,8 @@ public: typedef E exact_type;
- E& exact() { return static_cast<E&>(*this); } - const E& exact() const { return static_cast<const E&>(*this); } + E& exact() { return dynamic_cast<E&>(*this); } + const E& exact() const { return dynamic_cast<const E&>(*this); }
static std::string name() { @@ -169,7 +169,7 @@ { mlc_hierarchy::any_with_diamond<E>::exact_offset = (const char*) - static_cast<const mlc_hierarchy::any_with_diamond<E>*>(t) + dynamic_cast<const mlc_hierarchy::any_with_diamond<E>*>(t) - (const char*) t; mlc_hierarchy::any_with_diamond<E>::offset_assigned = true; }
"Giovanni" == Giovanni Palma giovanni@lrde.epita.fr writes:
@@ -70,7 +70,7 @@ private: // This stores the actual value of the offset between the this // pointer and the address of the exact type. This enables diamond
- // shaped hierarchies (static_cast can't and reinterpret_cast or
- // shaped hierarchies (static_cas can't and reinterpret_cast or // (Exact*)(void*) cast are unsafe and compiler dependent). static const int exact_offset;