Move to a Result<T> system of static methods on types like String and Vector which can fail when allocating memory such that the constructor cannot fail. That means copies like the following:
String foo = "something that can fail";
Will no longer compile and instead you'll have to write:
Result<String> foo = "something that can fail";
Which will be enabled by Result<T> calling a special init_from_result static method.
Similarly, constructors like
Will no longer work, instead you'll write something like:
auto data = Vector<Byte>::create_with_size(1024);
Which gives a Result<Vector<Byte>> data
And likewise, copy constructors will call special copy_from_result static methods, so
Result<String> a = "hello world";
String b = move(*a);
String c = b; // error
Result<String> d = b; // works
The Result<T> type is special in that it will allow anything returning Result<T> to return an Error type which is just a wrapped String indicating the resulting error.
Move to a
Result<T>system of static methods on types likeStringandVectorwhich can fail when allocating memory such that the constructor cannot fail. That means copies like the following:String foo = "something that can fail";Will no longer compile and instead you'll have to write:
Result<String> foo = "something that can fail";Which will be enabled by
Result<T>calling a specialinit_from_resultstatic method.Similarly, constructors like
Vector<Byte> data{1024};Will no longer work, instead you'll write something like:
Which gives a
Result<Vector<Byte>> dataAnd likewise, copy constructors will call special
copy_from_resultstatic methods, soThe
Result<T>type is special in that it will allow anything returningResult<T>to return anErrortype which is just a wrappedStringindicating the resulting error.