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

Program Listing for File const_loader.hpp

Return to documentation for file (include/ripple/padding/const_loader.hpp)

#ifndef RIPPLE_PADDING_CONST_LOADER_HPP
#define RIPPLE_PADDING_CONST_LOADER_HPP

#include "padding_loader.hpp"

namespace ripple {

template <typename T>
struct ConstLoader : public PaddingLoader<ConstLoader<T>> {
  T value = 0;

  ripple_all ConstLoader(T v) noexcept : value(v) {}

  template <typename Iterator, typename Dim>
  ripple_all constexpr auto
  load_front(Iterator&& it, int index, Dim&& dim) const noexcept -> void {
    *it = value;
  }

  template <typename Iterator, typename Dim>
  ripple_all constexpr auto
  load_back(Iterator&& it, int index, Dim&& dim) const noexcept -> void {
    *it = value;
  }
};

} // namespace ripple

#endif // RIPPLE_PADDING_CONST_LOADER_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