Skip to content

Compilation issue when using std::future #47

@gelldur

Description

@gelldur
/home/X/.cache/X/prebuild/X/install-Debug/include/dexode/eventbus/Bus.hpp:82:23: error: no matching function for call to 'create'
                auto postponeCall = PostponeHelper::create<Event>(std::move(event));
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/X/Project/X/X/src/backend/BackendApplication.cpp:124:14: note: in instantiation of function template specialization 'dexode::eventbus::Bus::postpone<event::backend::XYZ>' requested here
                                        guiBus->postpone(event::backend::XYZ{
                                                ^
/home/X/.cache/X/prebuild/X/install-Debug/include/dexode/eventbus/Bus.hpp:54:24: note: candidate function template not viable: no known conversion from 'typename std::remove_reference<XYZ &>::type' (aka 'event::backend::XYZ') to 'std::any' for 1st argument
        static PostponeHelper create(std::any&& event)

Example:

	guiBus->postpone(event::backend::XYZ{
		"text",
		std::async(std::launch::deferred, [state]() { return state->state(); })})

I would expect either working or more clear compile error. Maybe everything is ok but should work I guess...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions