commonMain.utility.Misc.kt Maven / Gradle / Ivy
package io.fluidsonic.stdlib
@Suppress("NOTHING_TO_INLINE")
public inline fun check(value: Int, inRange: IntRange, name: String): Unit =
check(value in inRange) { "$name must be in range $inRange: $value" }
@Suppress("NOTHING_TO_INLINE")
public inline fun check(value: Int, inRange: LongRange, name: String): Unit =
check(value in inRange) { "$name must be in range $inRange: $value" }
@Suppress("NOTHING_TO_INLINE")
public inline fun check(value: Long, inRange: IntRange, name: String): Unit =
check(value in inRange) { "$name must be in range $inRange: $value" }
@Suppress("NOTHING_TO_INLINE")
public inline fun check(value: Long, inRange: LongRange, name: String): Unit =
check(value in inRange) { "$name must be in range $inRange: $value" }
@Suppress("NOTHING_TO_INLINE")
public inline fun > check(value: Value, inRange: ClosedRange, name: String): Unit =
check(value in inRange) { "$name must be in range $inRange: $value" }
public fun identity(value: T): T =
value