SomeRanDev / reflaxe.CPP

An alternative C++ target for Haxe that generates dependent-less, GC-less C++17 code.
MIT License
72 stars 5 forks source link

how to generate code "std::move"? #19

Closed sonygod closed 1 year ago

sonygod commented 1 year ago

@:keep
    static function testInstance3(test:UniquePtr<Test>){

        test.say();
    }

    var test2:UniquePtr<Test>=new Test();
        testInstance3(test2);// is there  any function like std::move here?

only generate code

 std::unique_ptr<Test> test2 = std::make_unique<Test>();

      Main::testInstance3(test2);

should generate code like

    std::unique_ptr<Test> test2 = std::make_unique<Test>();

    Main::testInstance3(std::move(test2));
SomeRanDev commented 1 year ago

👌 Noted! I'll add a function to generate std::move statements.

I'll also add a cxx.Move<T> to generate Type&& arguments as well.

SomeRanDev commented 1 year ago

Added!

sonygod commented 1 year ago

nice! @RobertBorghese