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