Skip to content

Vector::span() does not compile when called #1982

Closed

Description

@RobinLockyer

Godot version

4.6.2

godot-cpp version

bc1fcd5

System information

Windows 11 Home, version 25H2

Issue description

Attempting to compile code using Vector::span() will give the following error:

In file included from src\test.cpp:1:
godot-cpp\include/godot_cpp/templates/vector.hpp: In instantiation of 'godot::Span<T> godot::Vector<T>::span() const [with T = int]':
src\test.cpp:7:11:   required from here
    7 |         test.span();
      |         ~~~~~~~~~^~
godot-cpp\include/godot_cpp/templates/vector.hpp:95:63: error: 'const class godot::CowData<int>' has no member named 'span'
   95 |         _FORCE_INLINE_ Span<T> span() const { return _cowdata.span(); }
      |                                                      ~~~~~~~~~^~~~

It seems that when Span was added from upstream godot some conversion functions in CowData were missed.

Steps to reproduce

#include <godot_cpp/templates/vector.hpp>

using namespace godot;

void test() {
	Vector<int> test;
	test.span(); //This line gives an error
}

Minimal reproduction project

N/A

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions