Index: Code/RDGeneral/Dict.cpp
===================================================================
--- Code/RDGeneral/Dict.cpp	(revision 2148)
+++ Code/RDGeneral/Dict.cpp	(working copy)
@@ -51,64 +51,5 @@
       }
     }
   };
-
-  template <typename T>
-  T Dict::fromany(const boost::any &arg) const {
-    return boost::any_cast<T>(arg);
-  };
-  template <typename T>
-  boost::any Dict::toany(T arg) const {
-    return boost::any(arg);
-  };
-
   
-#define ANY_FORCE(T) {tD.fromany< T >(boost::any(1));tD.toany< T >( T() );}
-
-  void force_types(){
-    Dict tD;
-    bool fooBool = tD.fromany<bool>(boost::any(1));
-    tD.toany<bool>(false);
-
-    int fooInt = tD.fromany<int>(boost::any(1));
-    fooInt += 1;
-    tD.toany<int>(1);
-
-    unsigned int fooUnsigned = tD.fromany<unsigned int>(boost::any(1));
-    fooUnsigned += 1;
-    tD.toany<unsigned int>(1);
-
-    double fooDouble = tD.fromany<double>(boost::any(1));
-    tD.toany<double>(1.0);
-
-    std::string fooString = tD.fromany<std::string>(boost::any(std::string("1")));
-    tD.toany<std::string>(std::string("1"));
-
-    ANY_FORCE(std::vector<int>);
-    ANY_FORCE(std::vector<unsigned int>);
-    ANY_FORCE(std::vector<unsigned long long>);
-    ANY_FORCE(std::vector<double>);
-    ANY_FORCE(std::vector<std::string>);
-
-    ANY_FORCE(std::vector< std::vector<int> >);
-    ANY_FORCE(std::vector< std::vector<double> >);
-
-    ANY_FORCE(boost::shared_array<double>);
-    ANY_FORCE(boost::shared_array<int>);
-
-    ANY_FORCE(std::list<int>);
-
-    
-    // FIX: it's UGLY that we have to include things like this:
-    //ANY_FORCE( boost::tuples::tuple<double,double,double> );
-    tD.fromany< boost::tuples::tuple<double,double,double> >(boost::any(1));
-    tD.toany< boost::tuples::tuple<double,double,double> >(boost::tuples::tuple<double,double,double>());
-    tD.fromany< boost::tuples::tuple<boost::uint32_t,boost::uint32_t,boost::uint32_t> >(boost::any(1));
-    tD.toany< boost::tuples::tuple<boost::uint32_t,boost::uint32_t,boost::uint32_t> >(boost::tuples::tuple<boost::uint32_t,boost::uint32_t,boost::uint32_t>());
-
-  }
-
-
-
-
-
 }
Index: Code/RDGeneral/Dict.h
===================================================================
--- Code/RDGeneral/Dict.h	(revision 2148)
+++ Code/RDGeneral/Dict.h	(working copy)
@@ -31,10 +31,6 @@
   //!  The actual storage is done using \c boost::any objects.
   //!
   class Dict {
-    //! \brief this function is used solely to force the instantiation of particular
-    //!    types of the \c Dict.toAny() and \c Dict.fromAny() methods in order to
-    //!    avoid link errors.
-    friend void force_types();
   public:
     typedef std::map<const std::string, boost::any> DataType;
     Dict(){
@@ -189,9 +185,11 @@
 
        \returns the converted object of type \c T
     */
-    template <typename T>
-      T fromany(const boost::any &arg) const;
     
+  template <typename T>
+  T fromany(const boost::any &arg) const {
+    return boost::any_cast<T>(arg);
+  };
 
     //----------------------------------------------------------
     //! Converts an instance of type \c T to \c boost::any
@@ -200,8 +198,10 @@
 
        \returns a \c boost::any instance
     */
-    template <typename T>
-      boost::any toany(T arg) const;
+  template <typename T>
+  boost::any toany(T arg) const {
+    return boost::any(arg);
+  };
 
   private:
     DataType _data; //!< the actual dictionary
Index: Code/RDGeneral/CMakeLists.txt
===================================================================
--- Code/RDGeneral/CMakeLists.txt	(revision 2148)
+++ Code/RDGeneral/CMakeLists.txt	(working copy)
@@ -1,11 +1,6 @@
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/versions.h.cmake 
                ${CMAKE_CURRENT_SOURCE_DIR}/versions.h )
 
-if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
-# Dict.cpp behaves badly if compiled with optimization under g++
-SET_SOURCE_FILES_PROPERTIES(Dict.cpp PROPERTIES COMPILE_FLAGS -O0)
-endif()
-
 rdkit_library(RDGeneral 
               Invariant.cpp types.cpp utils.cpp RDLog.cpp Dict.cpp SHARED)
 
