A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1890.html below:

CWG Issue 1890

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

1890. Member type depending on definition of member functionSection: 11.4  [class.mem]     Status: drafting     Submitter: Hubert Tong     Date: 2014-03-07

Consider an example like:

  struct A {
    struct B {
      auto foo() { return 0; }
    };
    decltype(B().foo()) x;
  };

There does not appear to be a prohibition of cases like this, where the type of a member depends on the definition of a member function.

(See also issues 1360, 1397, and 2335.)

Additional notes (January, 2023):

The following example might be related:

  #include <type_traits>

  struct Bar {
    struct Baz {
      int a = 0;
    };
    static_assert(std::is_default_constructible_v<Baz>);
  };

Additional notes (November, 2023):

The following example is also rejected by implementations, but it is allowed by the rules:

    struct A {
      static bool f2() { return f(); }

      static consteval bool f() { return true; }
    };

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4