Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written)
OpenAssistant Conversations (oasst2)
Write me a program in C++ to compute the factorial of a number at compile time, using…
In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
- User
Write me a program in C++ to compute the factorial of a number at compile time, using only C++03
- Assistant
Here is a a C++ program that computes a factorial at compile time, that is compliant with the C++03 standard.
template<unsigned int N> unsigned int fac() { return fac<N-1>() * N; }; template<> unsigned int fac<0>() { return 1; }Using templates and template specialization we define a function fac() which returns fac()*N, specializing the case where N = 0 to return 1.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →