Displaying 4 results from an estimated 4 matches for "sinku".
Did you mean:
sink
2013 Nov 21
3
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
...= new Foo;
return f; // works as expected
}
ErrorOr<std::unique_ptr<Foo>> factoryEU() {
std::unique_ptr<Foo> f(new Foo);
return f; // ERROR: call to implicitly-deleted copy constructor of 'std::__1::unique_ptr<Foo, std::__1::default_delete<Foo> >’
}
void sinkU(std::unique_ptr<Foo> f) {
f->doit(); // works as expected
}
void sinkE(ErrorOr<Foo*> f) {
f->doit(); // ERROR: member reference base type 'typename remove_reference<Foo *>::type' (aka 'Foo *') is not a structure or union'
}
void sinkEU(ErrorOr<s...
2013 Nov 22
0
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
...le and the
same type. In this case you have an implicit conversion that would work
like any other conversion of an lvalue.
So you have to write return std::move(f); unfortunately. (or you could be
more explicit/verbose and say return ErrorOr<...>(std::move(f)); )
> }
>
>
> void sinkU(std::unique_ptr<Foo> f) {
> f->doit(); // works as expected
> }
>
> void sinkE(ErrorOr<Foo*> f) {
> f->doit(); // ERROR: member reference base type 'typename
> remove_reference<Foo *>::type' (aka 'Foo *') is not a structure or union'...
2013 Nov 22
3
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
...and say return ErrorOr<...>(std::move(f)); )
Is there no way to promote the return value automatically? If you make the local variable be of type Error<std::unique_ptr<Foo>>, you run into the errors that you can’t access its methods (below).
>
> }
>
>
> void sinkU(std::unique_ptr<Foo> f) {
> f->doit(); // works as expected
> }
>
> void sinkE(ErrorOr<Foo*> f) {
> f->doit(); // ERROR: member reference base type 'typename remove_reference<Foo *>::type' (aka 'Foo *') is not a structure or union'
&g...
2013 Nov 22
0
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
...d Smith in case he can comment on future work in the
C++ standard space).
> If you make the local variable be of type Error<std::unique_ptr<Foo>>,
> you run into the errors that you can’t access its methods (below).
>
>
>
>
>> }
>>
>>
>> void sinkU(std::unique_ptr<Foo> f) {
>> f->doit(); // works as expected
>> }
>>
>> void sinkE(ErrorOr<Foo*> f) {
>> f->doit(); // ERROR: member reference base type 'typename
>> remove_reference<Foo *>::type' (aka 'Foo *') is not...