Kudu C++ client API
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
shared_ptr.h File Reference

Smart pointer typedefs for externally-faced code. More...

#include <tr1/memory>

Go to the source code of this file.

Detailed Description

Smart pointer typedefs for externally-faced code.

Kudu uses c++11 features internally, but provides a client interface which does not require c++11. We use std::tr1::shared_ptr in our public interface to hold shared instances of KuduClient, KuduSession, and KuduTable.

Unfortunately, if using clang on OS X, libc++ is the default C++ standard library implementation and it is required when compiling with c++11. However, libc++ does not include the TR1 APIs. As a workaround, we use std::shared_ptr on OS X. Since OS X is for development only, it is acceptable to require clients to compile with c++11.

In order to allow applications to compile against Kudu on both Linux and OS X, we provide this typedef which resolves to std::tr1::shared_ptr on Linux and std::shared_ptr on OS X. Clients are encouraged to use these typedefs in order to ensure that applications will compile on both Linux and OS X.