Home  >  Article  >  Backend Development  >  Here are a few title options, keeping in mind the need for a question format and relevance to the article: **Option 1 (Direct and concise):** * **Can C 17 Achieve Partial Class Template Argument De

Here are a few title options, keeping in mind the need for a question format and relevance to the article: **Option 1 (Direct and concise):** * **Can C 17 Achieve Partial Class Template Argument De

Susan Sarandon
Susan SarandonOriginal
2024-10-25 00:10:30450browse

Here are a few title options, keeping in mind the need for a question format and relevance to the article:

**Option 1 (Direct and concise):**

* **Can C  17 Achieve Partial Class Template Argument Deduction?**

**Option 2 (Highlighting the limitation):**

Partial Class Template Argument Deduction in C 17: A Potential Future Feature

In C 17, class template argument deduction (CTAD) enables the compiler to infer template arguments based on the inferred type of a variable or expression. However, CTAD currently requires that all template arguments be specified or all be inferred.

This raises the question: is it possible to partially specify template arguments and have the remaining ones inferred?

Despite attempts such as using alias templates, direct partial deduction is still unavailable. However, there is a proposed paper (P1814) under consideration for C 20 that seeks to enable support for partial CTAD using alias templates.

Until such a proposal is accepted, there are no supported workarounds for implementing partial deduction. However, the upcoming C 20 standard draft includes support for Alias templates (P1814) and Aggregates (P1816), addressing some of the limitations of CTAD.

The above is the detailed content of Here are a few title options, keeping in mind the need for a question format and relevance to the article: **Option 1 (Direct and concise):** * **Can C 17 Achieve Partial Class Template Argument De. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn