Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-9157

Quick fix "Move Definition outside class" does not move member variable/base class initialization

    XMLWordPrintable

Details

    • 39d000430ee3164a5c2cea8e22558c6f4fbbfc36

    Description

      In

       
      #include <iostream>
      
      class Foo {
          Foo() : a(42), b(3.141) { std::cout << "Hallo"; }
      
      private:
          int a;
          float b;
      };
      
      
      int main(int argc, char *argv[])
      {
      
          return 0;
      }
      

      Choose "Move definition outside class" over the Foo constructor, resulting in

       
      #include <iostream>
      
      class Foo {
          Foo() : a(42), b(3.141);
      
      private:
          int a;
          float b;
      };
      
      Foo::Foo() { std::cout << "Hallo"; }
      
      
      
      int main(int argc, char *argv[])
      {
      
          return 0;
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            erikv Erik Verbruggen
            kleint Friedemann Kleint
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes