Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method with std::function parameter is not generated #1834

Open
dcsoft4 opened this issue Mar 7, 2024 · 1 comment
Open

Method with std::function parameter is not generated #1834

dcsoft4 opened this issue Mar 7, 2024 · 1 comment

Comments

@dcsoft4
Copy link

dcsoft4 commented Mar 7, 2024

Brief Description

Creating a C# wrapper for this CPP class fails to generate the async_read method.

namespace foo
{
    enum class ErrorCode : int
    {
        Success = 0,
        IncompleteTransfer = 1,
        BufferTooBig = 2,
        Disconnect = 3,
    };

    /// A Buffer holds a single message to be written or being read.
    using Buffer = std::vector<uint8_t>;

    using ReadCompletionHandler = std::function<void(ErrorCode, const Buffer &)>;

    class Bar
    {
    public:
        void async_read(const ReadCompletionHandler &handler);

    private:
        Buffer _buffer;
    };
}

OS: Windows 11 22H2
CppSharp version: 1.1.5.3168

Used settings

Target: MSVC

Other settings

Stack trace or incompilable generated code

It runs without error but the Foo.cs output doesn't have the method.
Full Visual Studio solution and output is in the next comment.

@dcsoft4
Copy link
Author

dcsoft4 commented Mar 7, 2024

cppsharpissue.zip

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

No branches or pull requests

1 participant