/*
 * Copyright 2015 Telenav Inc. All rights reserved.
 *
 *  Based on Boost noncopyable.hpp header file  
 *
 *  (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
 *  Software License, Version 1.0. (See accompanying file
 *  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 *
 *  See http://www.boost.org/libs/utility for documentation.
 */
#ifndef TN_FOUNDATION_NONCOPYABLE_HPP
#define TN_FOUNDATION_NONCOPYABLE_HPP

#include "foundation/cxx11compat.hpp"

#if !_TN_FOUNDATION_USE_STD
#  include "boost/noncopyable.hpp"
namespace tn {
  using boost::noncopyable;
}
#else
// Same as boost, but without actually requiring boost
namespace tn {
  //  Private copy constructor and copy assignment ensure classes derived from
  //  class noncopyable cannot be copied.
  //  Contributed by Dave Abrahams
  namespace noncopyable_  // protection from unintended ADL
  {
    class noncopyable
    {
     protected:
#if TN_CXX11
        constexpr noncopyable() = default;
        ~noncopyable() = default;
        noncopyable( const noncopyable& ) = delete;
        noncopyable& operator=( const noncopyable& ) = delete;
#else
        noncopyable() {}
        ~noncopyable() {}
      private:  
        noncopyable( const noncopyable& );
        noncopyable& operator=( const noncopyable& );
#endif
    };
  } // namespace noncopyable_

  typedef noncopyable_::noncopyable noncopyable;

} // namespace tn
#endif
#endif  /* TN_FOUNDATION_NONCOPYABLE_HPP */
