Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #71618
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: Template alias destructor call |
| Date | Mon, 27 Jan 2020 01:40:00 -0800 |
| Organization | A noiseless patient Spider |
| Lines | 22 |
| Message-ID | <86zhe9grv3.fsf@linuxsc.com> (permalink) |
| References | <r09o3o$a96$1@dont-email.me> <r0bsc1$jsa$1@dont-email.me> <r0busk$24i$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | reader02.eternal-september.org; posting-host="7c306968cf7022673062d49c54d79376"; logging-data="32427"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KAI63X9p8BVXMAUB+R7Hhatu+Q8M8xmE=" |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) |
| Cancel-Lock | sha1:KIlyR4uR9AYwATFEqSEsxMdiOEA= sha1:XE1BpZvFlxbQ8en6xzOv0s7h1cA= |
| Xref | csiph.com comp.lang.c++:71618 |
Show key headers only | View raw
Paavo Helde <myfirstname@osa.pri.ee> writes:
> [problems with x->~B<T>().]
>
> Thanks! The typedef workaround indeed seems to work:
>
> template <typename T>
> void foo(B<T>* x) {
> typedef B<T> B_t;
> x->~B_t();
> }
Alternatively,
template <typename T>
void foo(B<T>* x) {
using B_t = B<T>;
x->~B_t();
}
Don't take this as a complaint, it is simply an unabashed plug
for choosing 'using' over 'typedef' (my own personal preference).
Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread
Template alias destructor call Paavo Helde <myfirstname@osa.pri.ee> - 2020-01-22 17:01 +0200
Re: Template alias destructor call "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2020-01-23 11:26 +0100
Re: Template alias destructor call Paavo Helde <myfirstname@osa.pri.ee> - 2020-01-23 13:09 +0200
Re: Template alias destructor call Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-01-27 01:40 -0800
csiph-web