Once in a blue moon I need to remember what the syntax for C++ explicit template instantiation is. All I need is a short snippet showing me an example of the syntax, but usually this means asking google and then trawling through several tangential SO questions ("why would one use this feature?") or scrolling through cppreference until I am reasonably confident I am looking at a valid example. This, to me, sounds exactly like the use case you are targeting.
Here is the kind of output that would have been meaningful/useful to me (although I was only looking for the second part, since I already knew the theory just not the syntax):
An explicit template instantiation definition (usually placed in a source file) makes the compiler instantiate the template for the given arguments. An explicit template instantiation declaration (usually placed in the header) tells the compiler that the template will already be instantiated elsewhere, so implicit instantiation can be skipped.
template
class Foo {};
// Explicit template instantiation declaration:
extern template class Foo;
// Explicit template instantiation definition:
template class Foo;
I tried six different queries, of the form "C++ explicit template instantiation [declaration|definition] [syntax]".In all cases, the synthesized explanation was either gibberish or flat out wrong. For example:
> Explicit template instantiation is a feature of C++11 that allows you to declare a template as a class, rather than a function. This means that if you want to use the template in a program, you don't have to declare it in the program itself, but rather in the template file. [Entirely nonsensical]
> Explicit template instantiation definitions can be put into header files, but they can't be put in source files. [Aside from not actually explaining the feature, this is more or less exactly backwards!]
The best it managed to output was a mediocre explanation of what a template is. I mean, it is about what I would expect a language model to interpolate from e.g. the StackOverflow corpus of questions tagged "C++" and "template", but it is a very far cry from being useful.
The quality of the code snippets was better, but still not at a usable level. Among outputs like `mytemplate.cpp`, `extern template` and compiler error messages, some snippets did correctly employ the syntax. It's clear that the model is selecting query-related code from query-related questions/tutorials, but it's still very hit and miss and not very focused. In my case, it certainly didn't "understand" the declaration/definition distinction, and even for most "good" snippets you first had to picture a bunch of surrounding code to make sense of it.
I'd say from a technical level the code snippet output is certainly impressive. But at this point I would have no reason to use your search engine over others for this narrow task of recalling the correct syntax for a language feature (or at least this one in particular - maybe it is too deep), because it involves just as much comparing snippets from various sources as opening the top three google results would - except without having any of the context. And if I didn't already know the topic quite well, none of the outputs (or even all 18 of them together) would have made me confident enough to say "ok, got it, this is the syntax I need to use".