mojo
mojo copied to clipboard
[Feature Request] `is_trivial`
Review Mojo's priorities
- [X] I have read the roadmap and priorities and I believe this request falls within the priorities.
What is your request?
It would be nice to have a function that check if an AnyRegType
became AnyType
:
fn is_trivial[T:AnyTrivialRegType]()->Bool:
return True
fn is_trivial[T:AnyType]()->Bool:
return False
def main():
print(is_trivial[Int]()) #not yet
What is your motivation for this change?
To simplify List
that currently take 2 parameters: type
and is_trivial_hint
,
it could also be useful in InlinedFixedVector.__del__
:+1:
Any other details?
No response