{{- if and (hasPrefix (.Get 0) "std::") (not (hasPrefix (.Get 0) "std::experimental")) (not (in (.Get 0) "print(")) }} {{- if hasPrefix (.Get 0) "std::errc" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::error_category" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::error_code" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::exception_ptr" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::generic_category" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::is_error_code_enum" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::is_error_condition_enum" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::in_place_type_t" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::launder" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::logic_error" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::make_error_code" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::make_exception_ptr" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::optional" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::rethrow_exception" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::system_category" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::system_error" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::terminate" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::variant" }} {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::expected" }} P0323 {{ .Get 0 }} {{- else if hasPrefix (.Get 0) "std::unexpected" }} P0323 {{ .Get 0 }} {{- else }} {{- errorf "Unknown cppreference target %s" (.Get 0) }} {{- end }} {{- else }} {{- $api_found := false }} {{- $api_title := "" }} {{- $api_url := "" }} {{- $api := .Get 0 }} {{- range .Site.Pages }} {{- if in .Title $api -}} {{- if $api_found }} {{- if lt (len .Title) (len $api_title) }} {{- $api_title = .Title }} {{- $api_url = .URL }} {{- end }} {{- else }} {{- $api_title = .Title }} {{- $api_url = .URL }} {{- $api_found = true }} {{- end }} {{- end }} {{- end }} {{- if $api_found -}} {{ $api }} {{- else }} {{- errorf "%s: API reference page for '%s' not found, please use an identifier wholly contained in a page title" .Position (.Get 0) }} API NOT FOUND IN DOCS {{ .Get 0 }} {{- end }} {{- end }}