Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.iso-c++ > #2089
| From | ram@zedat.fu-berlin.de (Stefan Ram) |
|---|---|
| Newsgroups | de.comp.lang.iso-c++ |
| Subject | Re: std::tuple C++11 Frage |
| Date | 2018-08-31 18:06 +0000 |
| Organization | Stefan Ram |
| Message-ID | <explicit-20180831190411@ram.dialup.fu-berlin.de> (permalink) |
| References | <pm90i3$snh$1@news.albasani.net> <tuple-list-20180831020156@ram.dialup.fu-berlin.de> |
ram@zedat.fu-berlin.de (Stefan Ram) writes:
>(n4296, 20.4.2.1, »constexpr explicit tuple(const Types&...);«),
>und zur Umwandlung der Einträge einer Initialisierungsliste
>wird ein nicht-expliziter Konstruktor benötigt
>(nur mit gcc ausprobiert, keine Quelle dafür gefunden).
Keine Quelle gefunden, weil es vielleicht nicht stimmt!
Das folgende Programm wird von einer neueren Version von gcc
akzeptiert, aber von einer etwas älteren Version von clang
zurückgewiesen (»no matching constructor for initialization
of '::std::tuple<ex>'«).
main.cpp
#include <iostream>
#include <ostream>
#include <string>
#include <tuple>
using namespace ::std::literals;
struct im { im( int ){} };
struct ex { explicit ex( int ){} };
int main()
{ ::std::tuple< im >im{ 1 };
::std::tuple< ex >ex{ 1 };
::std::cout << "done.\n"s; }
In n4762 fand ich nach erneuter Suche immer noch keine
Stelle, die besagt, daß eine initializer-clause einen
nicht-expliziten Konstruktor verlangt.
Die Antwort auf Markus' Frage ist also noch nicht gefunden!
Back to de.comp.lang.iso-c++ | Previous | Next — Previous in thread | Next in thread | Find similar
std::tuple C++11 Frage Markus Donath <nntp@online.de> - 2018-08-30 16:56 +0200
Re: std::tuple C++11 Frage ram@zedat.fu-berlin.de (Stefan Ram) - 2018-08-31 01:05 +0000
Re: std::tuple C++11 Frage ram@zedat.fu-berlin.de (Stefan Ram) - 2018-08-31 18:06 +0000
Re: std::tuple C++11 Frage Markus Donath <nntp@online.de> - 2018-09-13 11:17 +0200
csiph-web