di 0.1.0
Loading...
Searching...
No Matches
possibly_const_container.h
Go to the documentation of this file.
1#pragma once
2
5#include "di/util/as_const.h"
6
7namespace di::container::detail {
8template<concepts::InputContainer Con>
9constexpr auto possibly_const_container(Con& container) -> auto& {
10 if constexpr (concepts::ConstantContainer<Con const> && !concepts::ConstantContainer<Con>) {
11 return util::as_const(container);
12 } else {
13 return container;
14 }
15}
16}