Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

core.internal.switch_

This module contains compiler support for switch...case statements
License:
Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)
pure nothrow @nogc @safe int __switch(T, caseLabels...)(scope const T[] condition);
Support for switch statements switching on strings.
Parameters:
caseLabels sorted array of strings generated by compiler. Note the strings are sorted by length first, and then lexicographically.
T[] condition string to look up in table
Returns:
index of match in caseLabels, a negative integer if not found
void __switch_error()(string file = __FILE__, size_t line = __LINE__);
Compiler lowers final switch default case to this (which is a runtime error) Old implementation is in core/exception.d