Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
2 votes
1 answer
120 views

Short version: Does an explicit instantiation declaration guarantee that a visible template definition is never used (unless an explicit instantiation definition is also encountered), and therefore ...
2 votes
1 answer
103 views

Given a template T and some type U, I can write a trait to see if U is an instantiation of T. For a simple case of a single template argument the trait could look like this: #include <type_traits&...
2 votes
3 answers
284 views

I implemented std::hash<std::string> in the usual way, by specializing the std::hash template. But then I realized that these should already be provided by the <string> header (https://www....
1 vote
1 answer
108 views

I have a project where I use function templates to allow users to swap in function specializations at compile time, so there is a default version provided in a library of common code and an optional ...
0 votes
0 answers
58 views

I'm attempting to create a catch-all template method of Foo::show and specialize a few types. In the example below, the specialization of double and char* when "asdf" is passed. But when I ...
3 votes
1 answer
124 views

I'm making my own test framework in c++ in order to learn more of this language (and wow how much I learned), but I've just hit a critical point -> I try to specialize my contains check to fail ...
0 votes
1 answer
166 views

I started learning patterns in c++ and tried to create a factorial function that, if possible, will be executed in compile time. Tell me how I can improve my implementation. Concept to check if T is ...
8 votes
1 answer
415 views

I'm reading "C++17 The Complete Guide" by Josuttis, and he mentions off-hand in an early chapter that full template specializations must have the same signature and return type because ...
1 vote
2 answers
100 views

I have a templated class Widget, which can store either primitive types, or types of another templated class Foo. I would like to access value stored in Widget directly for primitive types, or by ...
2 votes
2 answers
109 views

I am implementing a template Matrix class (depending on the underlying datatype and the size) and want to specialize some methods (determinant, inverse) for some specific sizes (2, 3 and 4). I first ...
0 votes
1 answer
80 views

Consider the following class template. template<template<typename U> typename T> class Entity { // Something }; What is the proper syntax to specialize Entity explicitly: by U, by T (...
3 votes
3 answers
127 views

Given a function passed as a template argument to a function, how can I determine the type of the of it's first parameter? For example: template<auto Func> void run_func(/* type of argument???? *...
0 votes
1 answer
51 views

Below I have two separate templated class hierarchies (Account -> CheckingAccount and Logger -> ConsoleLogger) and a template Bank class that uses both. The goal is to use different Loggers, one ...
2 votes
1 answer
63 views

Within template class Bank<T>, my goal is to create an overload for type Account to member function void Bank<T>::makeTransfer(T, T, const double), of signature void Bank<Account>::...
3 votes
1 answer
97 views

Fist of all, what I'm doing seems to work on all of GCC/Clang/MSVC/icc/etc, so my question is; is that by accident or does the standard require it to be allowed? In one way it seems like a logical ...
BCS's user avatar
  • 79.2k

15 30 50 per page
1
2 3 4 5
...
113

AltStyle によって変換されたページ (->オリジナル) /