HN user

affenape

36 karma
Posts0
Comments8
View on HN
No posts found.

From the proposal, I see a bunch of new keywords and rules - alright given the language's heritage. But what happens if I "relocate" a variable value - would a "shell" remain or how exactly C++ is supposed to handle this:

  auto value = create_value();
  if (some_cond) {
    consume_value(std::move(value)); // not sure whether it's move here, but I guess my point is clear
  }

  use_value(value);

Not necessarily. A coroutine encapsulates the entire state machine, which might pe a PITA to implement otherwise. Say, if I have a stateful network connection, that requires initialization and periodic encryption secret renewal, a coroutine implementation would be much slimmer than that of a state machine with explicit states.

For something having 2024 in its name I expected a more consistent error handling, but guess what:

* some functions like fsRenderCreate return 0 or 1 depending on the operation result;

* some like fsMapViewCreate say that a value less than 0 is returned on error;

* fsIOOpen says you should also consult with the fsIOGetLastError function on failure.

Hope somebody considers adding the errno.