• Docs >
  • Program Listing for File pointer_wrapper.hpp
Shortcuts

Program Listing for File pointer_wrapper.hpp

Return to documentation for file (include/ripple/storage/pointer_wrapper.hpp)

#ifndef RIPPLE_STORAGE_POINTER_WRAPPER_HPP
#define RIPPLE_STORAGE_POINTER_WRAPPER_HPP

#include <ripple/utility/portability.hpp>

namespace ripple {

template <typename T>
struct PointerWrapper {
  ripple_all PointerWrapper(T data) noexcept : data_{data} {}

  // clang-format off
  ripple_all auto operator->() noexcept -> T* {
    return &data_;
  }

  ripple_all auto operator->() const noexcept -> const T* {
    return &data_;
  }

 private:
  T data_;
};

} // namespace ripple

#endif // RIPPLE_STORAGE_POINTER_WRAPPER_HPP

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples