Why can I not instantiate a class whose constructor is private in a friend class?Can an abstract class have a constructor?Can I call a constructor from another constructor (do constructor chaining) in C++?Why can templates only be implemented in the header file?Why do this() and super() have to be the first statement in a constructor?Why can't I change a private member of a class from a friend class in a different namespace?Passing a class as argument which has a private constructor that takes no parametersFriend function is not accessing private members of another friend classDeclaring constructors as private shows errors. Is at least one public constructor mandatory?Cannot access private member declared in class, even declared friend classPrivate Data member is inaccessible in Friend Function

Can hackers enable the camera after the user disabled it?

Why isn't nylon as strong as kevlar?

Will 700 more planes a day fly because of the Heathrow expansion?

I'm in your subnets, golfing your code

Prove that the limit exists or does not exist

In Avengers 1, why does Thanos need Loki?

Make some Prime Squares!

How should I tell my manager I'm not paying for an optional after work event I'm not going to?

I drew a randomly colored grid of points with tikz, how do I force it to remember the first grid from then on?

If I readied a spell with the trigger "When I take damage", do I have to make a constitution saving throw to avoid losing Concentration?

How wide is a neg symbol, how to get the width for alignment?

How important is people skills in academic career and applications?

Why wasn't the Night King naked in S08E03?

What is the name of this hexagon/pentagon polyhedron?

BOOM! Perfect Clear for Mr. T

Should I replace my bicycle tires if they have not been inflated in multiple years

Why is Arya visibly scared in the library in S8E3?

Point of the the Dothraki's attack in GoT S8E3?

What does a spell range of "25 ft. + 5 ft./2 levels" mean?

How do LIGO and VIRGO know that a gravitational wave has its origin in a neutron star or a black hole?

Would Hubble Space Telescope improve black hole image observed by EHT if it joined array of telesopes?

Can you complete the sequence?

What matters more when it comes to book covers? Is it ‘professional quality’ or relevancy?

Why is B♯ higher than C♭ in 31-ET?



Why can I not instantiate a class whose constructor is private in a friend class?


Can an abstract class have a constructor?Can I call a constructor from another constructor (do constructor chaining) in C++?Why can templates only be implemented in the header file?Why do this() and super() have to be the first statement in a constructor?Why can't I change a private member of a class from a friend class in a different namespace?Passing a class as argument which has a private constructor that takes no parametersFriend function is not accessing private members of another friend classDeclaring constructors as private shows errors. Is at least one public constructor mandatory?Cannot access private member declared in class, even declared friend classPrivate Data member is inaccessible in Friend Function






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








16















I have two classes; Salary that is intended to hold information and calculations regarding the salary of an employee and Employee that has an object of type class Salary and some members like name and address of the employee...




  • What I want to do is to prevent class Salary from being instantiated except by class Employee. So I declared the constructors of Salary private and made Employee a friend of Salary. But I get errors:



    class Employee;

    class Salary
    public:

    private:
    Salary() : revenue_, cost_
    Salary(int x, int y) : revenue_ x ,
    cost_ y


    int revenue_, cost_;
    friend class Employee;
    ;

    class Employee
    public:
    std::string name_;
    Salary sal;
    ;

    int main()

    Employee emp; // "Salary::Salary()" is inaccessible




  • The problem goes away if I forward declare main:



    int main(int, char*[]);


    And make main a friend of class Salary like so in Salary:



    class Salary 
    //...
    friend int main(int argc, char* argv[]);
    ;


Now the program compiles correctly!



*** Another thing in main if I declare an object this way:



Employee emp; // ok
Employee emp; // error?









share|improve this question
























  • Why are you making Salary's constructor private? It seems like there are contexts when you'd want to use Salary outside of Employee

    – J. Antonio Perez
    Apr 23 at 22:40

















16















I have two classes; Salary that is intended to hold information and calculations regarding the salary of an employee and Employee that has an object of type class Salary and some members like name and address of the employee...




  • What I want to do is to prevent class Salary from being instantiated except by class Employee. So I declared the constructors of Salary private and made Employee a friend of Salary. But I get errors:



    class Employee;

    class Salary
    public:

    private:
    Salary() : revenue_, cost_
    Salary(int x, int y) : revenue_ x ,
    cost_ y


    int revenue_, cost_;
    friend class Employee;
    ;

    class Employee
    public:
    std::string name_;
    Salary sal;
    ;

    int main()

    Employee emp; // "Salary::Salary()" is inaccessible




  • The problem goes away if I forward declare main:



    int main(int, char*[]);


    And make main a friend of class Salary like so in Salary:



    class Salary 
    //...
    friend int main(int argc, char* argv[]);
    ;


Now the program compiles correctly!



*** Another thing in main if I declare an object this way:



Employee emp; // ok
Employee emp; // error?









share|improve this question
























  • Why are you making Salary's constructor private? It seems like there are contexts when you'd want to use Salary outside of Employee

    – J. Antonio Perez
    Apr 23 at 22:40













16












16








16


8






I have two classes; Salary that is intended to hold information and calculations regarding the salary of an employee and Employee that has an object of type class Salary and some members like name and address of the employee...




  • What I want to do is to prevent class Salary from being instantiated except by class Employee. So I declared the constructors of Salary private and made Employee a friend of Salary. But I get errors:



    class Employee;

    class Salary
    public:

    private:
    Salary() : revenue_, cost_
    Salary(int x, int y) : revenue_ x ,
    cost_ y


    int revenue_, cost_;
    friend class Employee;
    ;

    class Employee
    public:
    std::string name_;
    Salary sal;
    ;

    int main()

    Employee emp; // "Salary::Salary()" is inaccessible




  • The problem goes away if I forward declare main:



    int main(int, char*[]);


    And make main a friend of class Salary like so in Salary:



    class Salary 
    //...
    friend int main(int argc, char* argv[]);
    ;


Now the program compiles correctly!



*** Another thing in main if I declare an object this way:



Employee emp; // ok
Employee emp; // error?









share|improve this question
















I have two classes; Salary that is intended to hold information and calculations regarding the salary of an employee and Employee that has an object of type class Salary and some members like name and address of the employee...




  • What I want to do is to prevent class Salary from being instantiated except by class Employee. So I declared the constructors of Salary private and made Employee a friend of Salary. But I get errors:



    class Employee;

    class Salary
    public:

    private:
    Salary() : revenue_, cost_
    Salary(int x, int y) : revenue_ x ,
    cost_ y


    int revenue_, cost_;
    friend class Employee;
    ;

    class Employee
    public:
    std::string name_;
    Salary sal;
    ;

    int main()

    Employee emp; // "Salary::Salary()" is inaccessible




  • The problem goes away if I forward declare main:



    int main(int, char*[]);


    And make main a friend of class Salary like so in Salary:



    class Salary 
    //...
    friend int main(int argc, char* argv[]);
    ;


Now the program compiles correctly!



*** Another thing in main if I declare an object this way:



Employee emp; // ok
Employee emp; // error?






c++ constructor friend-class






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 24 at 19:14









Boann

37.7k1291123




37.7k1291123










asked Apr 23 at 21:56









Syfu_HSyfu_H

429112




429112












  • Why are you making Salary's constructor private? It seems like there are contexts when you'd want to use Salary outside of Employee

    – J. Antonio Perez
    Apr 23 at 22:40

















  • Why are you making Salary's constructor private? It seems like there are contexts when you'd want to use Salary outside of Employee

    – J. Antonio Perez
    Apr 23 at 22:40
















Why are you making Salary's constructor private? It seems like there are contexts when you'd want to use Salary outside of Employee

– J. Antonio Perez
Apr 23 at 22:40





Why are you making Salary's constructor private? It seems like there are contexts when you'd want to use Salary outside of Employee

– J. Antonio Perez
Apr 23 at 22:40












4 Answers
4






active

oldest

votes


















17














Because you don't provide a constructor for Employee the braces in your initialization Employee emp; will perform an aggregate initialization, which essentially means that each member is initialized one-by-one using the default rules, in the context of main(). Since main() doesn't have access to the Salary constructor, it fails.



As others have pointed out, adding an Employee default constructor will resolve your problem:



class Employee 
public:
Employee() = default;
std::string name_;
Salary sal;
;





share|improve this answer




















  • 1





    I'm trying on MSVS and only Employee() ; allows Employee emp; to compile. Clang seems to accept Employee() = default;, but then again, Clang seems to accept having no default constructor here.

    – wally
    Apr 23 at 22:32







  • 1





    GCC does the same as Clang, and doesn't need a default constructor to compile in this case. Have you tried this answer on any specific compiler?

    – wally
    Apr 23 at 22:43












  • Thanks. it saves the day!

    – Syfu_H
    Apr 25 at 7:50


















2














You have to explicitly declare the default constructor of class Employee thus you can initialize an abject via uniform initialization:



class Employee 
public:
Employee() // add it
std::string name_;
Salary sal;
;

int main()
Employee emp; // now this should compile







share|improve this answer






























    2














    You need Employee's ctor to call the ctor of Salary. The ctor of Salary is not accessible from main.



    eg:



    class Employee 
    public:
    Employee() : sal()
    public:
    std::string name_;
    Salary sal;
    ;





    share|improve this answer
































      0














      If you erase the "" after "Employee emp" in your main() function it compiles just fine (gcc 7.3.1 on Fedora 27).






      share|improve this answer


















      • 4





        I recommend explaining why.

        – user4581301
        Apr 23 at 22:06











      • Yes. Not onyl GCC but also MSVC14 also compiles Employee emp; but why?

        – Syfu_H
        Apr 23 at 22:07






      • 1





        @Syfu_H Value Initialization. And I could be mistaken here (been caught on this in the past), but the Value Initialization is being replaced by Aggregate Initialization

        – user4581301
        Apr 23 at 22:15











      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55819962%2fwhy-can-i-not-instantiate-a-class-whose-constructor-is-private-in-a-friend-class%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      17














      Because you don't provide a constructor for Employee the braces in your initialization Employee emp; will perform an aggregate initialization, which essentially means that each member is initialized one-by-one using the default rules, in the context of main(). Since main() doesn't have access to the Salary constructor, it fails.



      As others have pointed out, adding an Employee default constructor will resolve your problem:



      class Employee 
      public:
      Employee() = default;
      std::string name_;
      Salary sal;
      ;





      share|improve this answer




















      • 1





        I'm trying on MSVS and only Employee() ; allows Employee emp; to compile. Clang seems to accept Employee() = default;, but then again, Clang seems to accept having no default constructor here.

        – wally
        Apr 23 at 22:32







      • 1





        GCC does the same as Clang, and doesn't need a default constructor to compile in this case. Have you tried this answer on any specific compiler?

        – wally
        Apr 23 at 22:43












      • Thanks. it saves the day!

        – Syfu_H
        Apr 25 at 7:50















      17














      Because you don't provide a constructor for Employee the braces in your initialization Employee emp; will perform an aggregate initialization, which essentially means that each member is initialized one-by-one using the default rules, in the context of main(). Since main() doesn't have access to the Salary constructor, it fails.



      As others have pointed out, adding an Employee default constructor will resolve your problem:



      class Employee 
      public:
      Employee() = default;
      std::string name_;
      Salary sal;
      ;





      share|improve this answer




















      • 1





        I'm trying on MSVS and only Employee() ; allows Employee emp; to compile. Clang seems to accept Employee() = default;, but then again, Clang seems to accept having no default constructor here.

        – wally
        Apr 23 at 22:32







      • 1





        GCC does the same as Clang, and doesn't need a default constructor to compile in this case. Have you tried this answer on any specific compiler?

        – wally
        Apr 23 at 22:43












      • Thanks. it saves the day!

        – Syfu_H
        Apr 25 at 7:50













      17












      17








      17







      Because you don't provide a constructor for Employee the braces in your initialization Employee emp; will perform an aggregate initialization, which essentially means that each member is initialized one-by-one using the default rules, in the context of main(). Since main() doesn't have access to the Salary constructor, it fails.



      As others have pointed out, adding an Employee default constructor will resolve your problem:



      class Employee 
      public:
      Employee() = default;
      std::string name_;
      Salary sal;
      ;





      share|improve this answer















      Because you don't provide a constructor for Employee the braces in your initialization Employee emp; will perform an aggregate initialization, which essentially means that each member is initialized one-by-one using the default rules, in the context of main(). Since main() doesn't have access to the Salary constructor, it fails.



      As others have pointed out, adding an Employee default constructor will resolve your problem:



      class Employee 
      public:
      Employee() = default;
      std::string name_;
      Salary sal;
      ;






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 23 at 22:31

























      answered Apr 23 at 22:15









      zdanzdan

      22.3k34865




      22.3k34865







      • 1





        I'm trying on MSVS and only Employee() ; allows Employee emp; to compile. Clang seems to accept Employee() = default;, but then again, Clang seems to accept having no default constructor here.

        – wally
        Apr 23 at 22:32







      • 1





        GCC does the same as Clang, and doesn't need a default constructor to compile in this case. Have you tried this answer on any specific compiler?

        – wally
        Apr 23 at 22:43












      • Thanks. it saves the day!

        – Syfu_H
        Apr 25 at 7:50












      • 1





        I'm trying on MSVS and only Employee() ; allows Employee emp; to compile. Clang seems to accept Employee() = default;, but then again, Clang seems to accept having no default constructor here.

        – wally
        Apr 23 at 22:32







      • 1





        GCC does the same as Clang, and doesn't need a default constructor to compile in this case. Have you tried this answer on any specific compiler?

        – wally
        Apr 23 at 22:43












      • Thanks. it saves the day!

        – Syfu_H
        Apr 25 at 7:50







      1




      1





      I'm trying on MSVS and only Employee() ; allows Employee emp; to compile. Clang seems to accept Employee() = default;, but then again, Clang seems to accept having no default constructor here.

      – wally
      Apr 23 at 22:32






      I'm trying on MSVS and only Employee() ; allows Employee emp; to compile. Clang seems to accept Employee() = default;, but then again, Clang seems to accept having no default constructor here.

      – wally
      Apr 23 at 22:32





      1




      1





      GCC does the same as Clang, and doesn't need a default constructor to compile in this case. Have you tried this answer on any specific compiler?

      – wally
      Apr 23 at 22:43






      GCC does the same as Clang, and doesn't need a default constructor to compile in this case. Have you tried this answer on any specific compiler?

      – wally
      Apr 23 at 22:43














      Thanks. it saves the day!

      – Syfu_H
      Apr 25 at 7:50





      Thanks. it saves the day!

      – Syfu_H
      Apr 25 at 7:50













      2














      You have to explicitly declare the default constructor of class Employee thus you can initialize an abject via uniform initialization:



      class Employee 
      public:
      Employee() // add it
      std::string name_;
      Salary sal;
      ;

      int main()
      Employee emp; // now this should compile







      share|improve this answer



























        2














        You have to explicitly declare the default constructor of class Employee thus you can initialize an abject via uniform initialization:



        class Employee 
        public:
        Employee() // add it
        std::string name_;
        Salary sal;
        ;

        int main()
        Employee emp; // now this should compile







        share|improve this answer

























          2












          2








          2







          You have to explicitly declare the default constructor of class Employee thus you can initialize an abject via uniform initialization:



          class Employee 
          public:
          Employee() // add it
          std::string name_;
          Salary sal;
          ;

          int main()
          Employee emp; // now this should compile







          share|improve this answer













          You have to explicitly declare the default constructor of class Employee thus you can initialize an abject via uniform initialization:



          class Employee 
          public:
          Employee() // add it
          std::string name_;
          Salary sal;
          ;

          int main()
          Employee emp; // now this should compile








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 23 at 22:14









          Raindrop7Raindrop7

          3,85031224




          3,85031224





















              2














              You need Employee's ctor to call the ctor of Salary. The ctor of Salary is not accessible from main.



              eg:



              class Employee 
              public:
              Employee() : sal()
              public:
              std::string name_;
              Salary sal;
              ;





              share|improve this answer





























                2














                You need Employee's ctor to call the ctor of Salary. The ctor of Salary is not accessible from main.



                eg:



                class Employee 
                public:
                Employee() : sal()
                public:
                std::string name_;
                Salary sal;
                ;





                share|improve this answer



























                  2












                  2








                  2







                  You need Employee's ctor to call the ctor of Salary. The ctor of Salary is not accessible from main.



                  eg:



                  class Employee 
                  public:
                  Employee() : sal()
                  public:
                  std::string name_;
                  Salary sal;
                  ;





                  share|improve this answer















                  You need Employee's ctor to call the ctor of Salary. The ctor of Salary is not accessible from main.



                  eg:



                  class Employee 
                  public:
                  Employee() : sal()
                  public:
                  std::string name_;
                  Salary sal;
                  ;






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 23 at 22:24









                  Pavan Manjunath

                  20.1k1181108




                  20.1k1181108










                  answered Apr 23 at 22:04









                  schuessschuess

                  536416




                  536416





















                      0














                      If you erase the "" after "Employee emp" in your main() function it compiles just fine (gcc 7.3.1 on Fedora 27).






                      share|improve this answer


















                      • 4





                        I recommend explaining why.

                        – user4581301
                        Apr 23 at 22:06











                      • Yes. Not onyl GCC but also MSVC14 also compiles Employee emp; but why?

                        – Syfu_H
                        Apr 23 at 22:07






                      • 1





                        @Syfu_H Value Initialization. And I could be mistaken here (been caught on this in the past), but the Value Initialization is being replaced by Aggregate Initialization

                        – user4581301
                        Apr 23 at 22:15















                      0














                      If you erase the "" after "Employee emp" in your main() function it compiles just fine (gcc 7.3.1 on Fedora 27).






                      share|improve this answer


















                      • 4





                        I recommend explaining why.

                        – user4581301
                        Apr 23 at 22:06











                      • Yes. Not onyl GCC but also MSVC14 also compiles Employee emp; but why?

                        – Syfu_H
                        Apr 23 at 22:07






                      • 1





                        @Syfu_H Value Initialization. And I could be mistaken here (been caught on this in the past), but the Value Initialization is being replaced by Aggregate Initialization

                        – user4581301
                        Apr 23 at 22:15













                      0












                      0








                      0







                      If you erase the "" after "Employee emp" in your main() function it compiles just fine (gcc 7.3.1 on Fedora 27).






                      share|improve this answer













                      If you erase the "" after "Employee emp" in your main() function it compiles just fine (gcc 7.3.1 on Fedora 27).







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Apr 23 at 22:03









                      Eric SokolowskyEric Sokolowsky

                      594




                      594







                      • 4





                        I recommend explaining why.

                        – user4581301
                        Apr 23 at 22:06











                      • Yes. Not onyl GCC but also MSVC14 also compiles Employee emp; but why?

                        – Syfu_H
                        Apr 23 at 22:07






                      • 1





                        @Syfu_H Value Initialization. And I could be mistaken here (been caught on this in the past), but the Value Initialization is being replaced by Aggregate Initialization

                        – user4581301
                        Apr 23 at 22:15












                      • 4





                        I recommend explaining why.

                        – user4581301
                        Apr 23 at 22:06











                      • Yes. Not onyl GCC but also MSVC14 also compiles Employee emp; but why?

                        – Syfu_H
                        Apr 23 at 22:07






                      • 1





                        @Syfu_H Value Initialization. And I could be mistaken here (been caught on this in the past), but the Value Initialization is being replaced by Aggregate Initialization

                        – user4581301
                        Apr 23 at 22:15







                      4




                      4





                      I recommend explaining why.

                      – user4581301
                      Apr 23 at 22:06





                      I recommend explaining why.

                      – user4581301
                      Apr 23 at 22:06













                      Yes. Not onyl GCC but also MSVC14 also compiles Employee emp; but why?

                      – Syfu_H
                      Apr 23 at 22:07





                      Yes. Not onyl GCC but also MSVC14 also compiles Employee emp; but why?

                      – Syfu_H
                      Apr 23 at 22:07




                      1




                      1





                      @Syfu_H Value Initialization. And I could be mistaken here (been caught on this in the past), but the Value Initialization is being replaced by Aggregate Initialization

                      – user4581301
                      Apr 23 at 22:15





                      @Syfu_H Value Initialization. And I could be mistaken here (been caught on this in the past), but the Value Initialization is being replaced by Aggregate Initialization

                      – user4581301
                      Apr 23 at 22:15

















                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55819962%2fwhy-can-i-not-instantiate-a-class-whose-constructor-is-private-in-a-friend-class%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                      Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                      What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company