mirror of
https://github.com/bspeice/speice.io
synced 2024-11-14 05:58:09 -05:00
Change the decltype order
This commit is contained in:
parent
75fab4c80d
commit
ee39f7bc43
@ -22,6 +22,13 @@ Same name and parameter signature, but return different types - `AsRef`
|
||||
|
||||
`.as_iter()`, and the iterator `Item` type
|
||||
|
||||
# decltype and compiler-named types
|
||||
|
||||
Rust has some types named by the compiler, but inaccessible in traits; can't return `impl SomeTrait`
|
||||
from traits. Can return `impl Future` from free functions and structs, but traits can't use
|
||||
compiler-generated types (associated types still need to name the type). C++ doesn't appear to have
|
||||
the same restrictions.
|
||||
|
||||
# Require static methods on a class?
|
||||
|
||||
Shouldn't be too hard - `T::some_method()` should be compilable.
|
||||
@ -343,10 +350,3 @@ mostly please just use concepts.
|
||||
Worth acknowledging that C++ can do interesting things with `protected`, `friend`, and others, that
|
||||
Rust can't. However, Rust can limit trait implementations to current crate ("sealed traits"), where
|
||||
C++ concepts are purely duck typing.
|
||||
|
||||
# decltype and compiler-named types
|
||||
|
||||
Rust has some types named by the compiler, but inaccessible in traits; can't return `impl SomeTrait`
|
||||
from traits. Can return `impl Future` from free functions and structs, but traits can't use
|
||||
compiler-generated types (associated types still need to name the type). C++ doesn't appear to have
|
||||
the same restrictions.
|
||||
|
Loading…
Reference in New Issue
Block a user