Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #589

Re: detecting incomplete type

Message-ID <511287F1.7040107@verizon.net> (permalink)
Newsgroups comp.std.c++
From James Kuyper <jameskuyper@verizon.net>
Subject Re: detecting incomplete type
Organization A noiseless patient Spider
References <kepfmi$gfm$1@news.ett.com.ua>
Date 2013-02-07 02:31 -0600

Show all headers | View raw


On 02/06/2013 02:50 AM, Balog Pal wrote:
>
> What is a standard way to tell whether a type is complete or not? In a
> way usable in say static_assert?

It's trivial to determine at compile time whether a type is complete by
writing code for which a diagnostic is required if the type is
incomplete. However, it sounds like you want a method that can be used
in program that compiles and executes successfully. I don't know of any
standard way to do that.

...
> So what to do then? I looked through type_traits for no help.

A few of the type_traits don't require that the type they are
instantiated for be complete (all of the ones in table 48, plus
is_const, is_volatile, is_signed, and is_unsigned), but offhand I can't
come up with any construct that has standard-defined behavior for an
incomplete type which is different from that required if the type had
been complete.


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

detecting incomplete type Balog Pal <pasa@lib.hu> - 2013-02-06 01:50 -0600
  Re: detecting incomplete type Daniel Krügler <daniel.kruegler@googlemail.com> - 2013-02-07 02:08 -0600
  Re: detecting incomplete type James Kuyper <jameskuyper@verizon.net> - 2013-02-07 02:31 -0600
  Re: detecting incomplete type James Kanze <james.kanze@googlemail.com> - 2013-02-07 02:32 -0600

csiph-web