Mojo function
platform_map
platform_map[T: Copyable & Movable, //, operation: Optional[String] = Optional(None), *, linux: Optional[T] = Optional(None), macos: Optional[T] = Optional(None), windows: Optional[T] = Optional(None)]() -> T
Helper for defining a compile time value depending on the current compilation target, raising a compilation error if trying to access the value on an unsupported target.
Example:
alias EDEADLK = platform_alias["EDEADLK", linux=35, macos=11]()
alias EDEADLK = platform_alias["EDEADLK", linux=35, macos=11]()
Parameters:
- T (
Copyable
&Movable
): The type of the value. - operation (
Optional
): The operation to show in the compilation error. - linux (
Optional
): Optional support for linux targets. - macos (
Optional
): Optional support for macos targets. - windows (
Optional
): Optional support for windows targets.
Returns:
T
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!