Skip to content

Conversation

@edbird
Copy link

@edbird edbird commented Nov 7, 2025

Hi,

I became interested in this project while searching for a ring buffer library. This seemed like it might be close to what I was looking for, which is something very simple.

I have attempted to convert the project to CMake so that it can be integrated into an existing CMake project using CMake's inbuilt mechanism to fetch dependencies from Github.

I get as far as this:

[ 91%] Built target compiles_at_all
In file included from /home/user/work/ring_view/test/fixed_ring.test.cc:3:
/home/user/work/ring_view/src/fixed_ring.h:112:107: error: use of parameter from containing function
  112 |     fixed_ring(size_type first_idx, size_type size, Args&&... args) noexcept(Container(std::forward<Args>(args)...)) :
      |                                                                                                           ^~~~
/home/user/work/ring_view/src/fixed_ring.h:112:59: note: ‘Args&& ... args’ declared here
  112 |     fixed_ring(size_type first_idx, size_type size, Args&&... args) noexcept(Container(std::forward<Args>(args)...)) :
      |                                                     ~~~~~~^~~~~~~~
gmake[2]: *** [test/CMakeFiles/fixed_ring_test.dir/build.make:79: test/CMakeFiles/fixed_ring_test.dir/fixed_ring.test.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:228: test/CMakeFiles/fixed_ring_test.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

Any idea what causes this or what the fix might be? I assume this used to compile and that the error is caused by changing the C++ version to C++ 23.

#define FIXED_RING_H

#include "ring_view.h"
#include "ring_span.h"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that ring_view was supposed to be ring_span here?

@@ -0,0 +1,68 @@
add_executable(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all of these will compile/run and work (yet). I have not yet fixed up each of the test files.


Container ctr_;
ring_view<T> rv_;
ring_span<T> rv_;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you've discovered that I didn't write any tests for "fixed_ring.h", huh? :)

The syntax error on line 112 is that noexcept(Container(std::forward<Args>(args)...)) should be noexcept(noexcept(Container(std::forward<Args>(args)...))) — yes, "noexcept noexcept" is correct, and what's there now is a dumb typo.

Pull requests for these simple typos/thinkos are welcome.
Pull requests for better testing are admirable, if perhaps not a good use of your time.
Pull requests for CMake support are highly unlikely to be accepted.

Have you looked at https://github.com/nonstd-lite/ring-span-lite ? I'd recommend his over mine, unless you've found something less-good about his.

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.

2 participants