---
title: "Nicolai Josuttis: P3828R1: Rename the to_input view to as_input"
date: 2026-03-07
audience: "LEWG, LWG Issues:"
reply-to:
  - "Nicolai Josuttis <nico@josuttis.de>"
document: p3828r1
paper-type: proposal
---

Nicolai Josuttis: P3828R1: Rename the to_input view to as_input

1

Project: ISO JTC1/SC22/WG21: Programming Language C++ Doc No: WG21 **P3828R1** Date: 2026-03-07 Reply to: Nicolai Josuttis (nico@josuttis.de)

Co-authors:

Audience: LEWG, LWG Issues:

Previous: P3828R0

## Rename the to_input view to as_input

The current name of the "to_input" view is misleading, because this sounds like the elements of the underlying range are actively processed (like with std::ranges::to). Instead it only ensures that the underlying range is seen ***as*** something different for those that later process the elements using this view. For views like this we usually use the name “as_...” (e.g. as_const or as_rvalue).

This paper proposes to rename the to_input view to as_input. This is both more intuitive and consistent.

Note that in this case this might include to also change the name of the section in the C++ standard and the name of the feature test macro.

## Proposed Wording

(All against N4944)

In principle simply rename all occurrences of “to_input” to “as_input” and “to input view” to “as input view.”

In **17.3.2 Header <version> synopsis [version.syn]**

Rename as follows:

:::wording-add

#define __cpp_lib_ranges_to<ins>as</ins>_input 202502L // freestanding, also in <ranges>

:::

**In 25.2 Header <ranges> synopsis [ranges.syn]**

Rename as follows:

:::wording-add

// 25.7.35, to <ins>as</ins> input view template<input_range V> requires view<V> class to<ins>as</ins>_input_view; template<class V> constexpr bool enable_borrowed_range<to<ins>as</ins>_input_view<V>> = enable_borrowed_range<V>; namespace views { inline constexpr unspecified to<ins>as</ins>_input = unspecified ; }

:::

Rename

### 25.7.35 To input view [range.to.input]

to

### 25.7.35 As input view [range.as.input]

Rename

### 25.7.35.1 Overview [range.to.input.overview]

to

### 25.7.35.1 Overview [range.as.input.overview]

Nicolai Josuttis: P3828R1: Rename the to_input view to as_input

2 and rename inside:

:::wording-add

1 to<ins>as</ins>_input_view presents a view of an underlying sequence as an input-only non-common range. [Note 1 : This is useful to avoid overhead that can be necessary to provide support for the operations needed for greater iterator strength. —end note]

:::

:::wording-add

2 The name views::to<ins>as</ins>_input denotes a range adaptor object (25.7.2). Let E be an expression and let T be decltype((E)). The expression views::to<ins>as</ins>_input(E) is expression-equivalent to:

:::

(2.1) — views::all(E) if T models input_range, does not satisfy common_range, and does not satisfy forward_range.

:::wording-add

(2.2) — Otherwise, to<ins>as</ins>_input_view(E).

:::

Rename

### 25.7.35.2 Class template to_input_view [range.to.input.view]

to

### 25.7.35.2 Class template as_input_view [range.as.input.view]

and rename inside:

:::wording-add

namespace std::ranges { template<input_range V> requires view<V> class to<ins>as_input_view : public view_interface< toas</ins>_input_view<V>> { V base_ = V(); // exposition only // 25.7.35.3, class template to<ins>as</ins>_input_view::iterator template<bool Const> class iterator ; // exposition only public: to<ins>as</ins>_input_view() requires default_initializable<V> = default; constexpr explicit to<ins>as</ins>_input_view(V base);

:::

:::wording-add

… template<class R> to<ins>as_input_view(R&&) -> toas</ins>_input_view<views::all_t<R>>; } constexpr explicit to<ins>as</ins>_input_view(V base);

:::

## 1 *Effects:* Initializes *base_* with std::move(base).

Rename

## 25.7.35.3 Class template to_input_view::iterator [range.to.input.iterator]

to

## 25.7.35.3 Class template as_input_view::iterator [range.as.input.iterator]

and rename inside:

:::wording-add

namespace std::ranges { template<input_range V> requires view<V> template<bool Const> class to<ins>as</ins>_input_view<V>::iterator { using Base = maybe-const <Const, V>; // exposition only

:::

…

## Acknowledgements

Thanks to a lot to everybody who helped and gave support to come to finally get this proposal done.

## Rev0:

First initial version.

## Rev1:

Fixed two typos according to LWG review.
