Opened 14 years ago

Last modified 11 years ago

#1900 new Bugs

Missing documentation for mpl::print in the MPL library

Reported by: Edward Diener <eldiener@…> Owned by: Joel Falcou
Milestone: Boost 1.36.0 Component: mpl
Version: Boost 1.35.0 Severity: Problem
Keywords: mpl print Cc:

Description

The documentation for mpl::print is missing from the Boost reference documentation.

Change History (5)

comment:1 by Marshall Clow, 14 years ago

Component: Nonempi
Owner: set to Douglas Gregor

comment:2 by Douglas Gregor, 14 years ago

Component: mpimpl
Owner: changed from Douglas Gregor to Aleksey Gurtovoy

comment:3 by Mathias Gaunard, 11 years ago

Owner: changed from Aleksey Gurtovoy to Joel Falcou

There is also a test but it doesn't appear to be compiled.

It would be nice if it were possible to test a warning is indeed emitted.

comment:4 by Robert Ramey, 11 years ago

Comment:

I find mpl print indispensable. However the following should be noted somewhere:

a) in order to work with GCC -Wall (or likely some more specific warning) must be set in the command line. Actually I should be -Wsign-compare. This is the case with gcc-4.5.3

b) The following only prints the first time

struct a; typedef a b;

mpl::print<a> this displays mpl::print<a> this doesn't display mpl::print<b> neither does this.

I don't think this can be actually fixed, but I would be nice to see it noted in the manual.

Robert Ramey

comment:5 by Mathias Gaunard, 11 years ago

There are better tricks for displaying types with GCC.

I personally just use

template<class T>
struct print
{
  unsigned : 80;
  typedef T type;
};

doesn't work at all with other compilers though.

Note: See TracTickets for help on using tickets.