Skip to content

Use ptrdiff_t in repeat_n_view to satisfy weakly_incrementable - #25

Open
scuzqy wants to merge 1 commit into
TartanLlama:mainfrom
scuzqy:repeat
Open

Use ptrdiff_t in repeat_n_view to satisfy weakly_incrementable#25
scuzqy wants to merge 1 commit into
TartanLlama:mainfrom
scuzqy:repeat

Conversation

@scuzqy

@scuzqy scuzqy commented Jun 6, 2026

Copy link
Copy Markdown

Hi @TartanLlama
I was having trouble using tl::repeat_n with msvc.
An MRE is:

// Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35728 for x64
  struct Vec3f {
    float data[3];
  };
  Vec3f value{1.0f, 2.0f, 3.0f};
  
  auto view = tl::views::repeat_n(Vec3f{1, 2, 3}, 5);
  std::vector<Vec3f> result;
  std::ranges::copy(view.begin(), view.end(), std::back_inserter(result));     // error C3889: call to object of class type 'std::ranges::_Copy_fn': no matching call operator found

Chain of requirements:
copy -> input_or_output_iterator -> weakly_incrementable -> signed-integer-like

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant