title: Error: "cannot bind packed field" while inserting data into std::map using insert function
body: <p>Can somebody tell me the difference between <code>#pragma pack(push,1)</code> and <code>__attribute__((packed))</code>? I am getting a compilation error if I use second type of struct packing which says </p>
  
  <blockquote>
  <pre><code>cannot bind packed field ‘ABC.abc::a’ to ‘unsigned int&amp;’
  </code></pre>
  </blockquote>
  
  <p>But if I use first type of struct packing then there is no compilation error. </p>
  
  <p>This is my sample code:</p>
  
  <pre><code>//DataStructure.h
  
  #ifndef DATASTRUCTURE_H_
  #define DATASTRUCTURE_H_
  
  struct abc
  {
      unsigned int a;
      float b;
  }__attribute__((packed));
  
  #endif /* DATASTRUCTURE_H_ */
  
  
  
  //Main.cpp
  #include&lt;iostream&gt;
  #include&lt;map&gt;
  #include "DataStructure.h"
  
  
  int main()
  {
      struct abc ABC;
      ABC.a=3;
      ABC.b=4.6f;
  
      std::map&lt;unsigned int,struct abc&gt; Mapp;
      Mapp.insert(std::make_pair(ABC.a,ABC));
  }
  </code></pre>