detect method

T detect(
  1. bool activated
)

Implementation

T detect(bool activated) {
  return activated ? active : inactive;
}