Due to possible Boost version/platform discrepancies, use weak pointer compare operator when using Boost.