project-hatohol/hatohol — pull request #380 by kou (2014-08-14 05:40:36+00:00)
Title: [server][CacheServiceDBClinet] Disable `new CacheServiceDBClinet`

fix #239

The current implementation causes build warning on CentOS 6:

CXX CacheServiceDBClient.lo
In file included from CacheServiceDBClient.cc:25:
CacheServiceDBClient.h: In static member function 'static void* CacheServiceDBClient::operator new(size_t)':
CacheServiceDBClient.h:52: warning: 'operator new' must not return NULL unless it is declared 'throw()' (or -fcheck-new is in effect)

We can just remove implementation of `operator new()` to disable `new
CacheServiceDBClient`. If someone use `new CacheServiceDBClient`,
compiler reports the following error:

error: ‘static void* CacheServiceDBClient::operator new(size_t)’ is private

So we can detect `new CacheServiceDBClient` on build time.