Fabmaster: fix MSVC build
std::map is not move-constructable on MSVC because it is not declared noexcept (and is not required to be by the standard) This means that a struct containing graphic_element cannot be inserted into a vector with move semantics without compile errors. However, wrapping it in a unique_ptr works.
This commit is contained in:
parent
65f90f141f
commit
1754504234
|
@ -1171,7 +1171,7 @@ size_t FABMASTER::processGeometry( size_t aRow )
|
|||
}
|
||||
|
||||
GEOM_GRAPHIC& graphic = board_graphics.back();
|
||||
graphic.elements.emplace( std::move( gr_item ) );
|
||||
graphic.elements->emplace( std::move( gr_item ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1188,7 +1188,7 @@ size_t FABMASTER::processGeometry( size_t aRow )
|
|||
gr->second.id = id;
|
||||
}
|
||||
|
||||
auto result = gr->second.elements.emplace( std::move( gr_item ) );
|
||||
auto result = gr->second.elements->emplace( std::move( gr_item ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1850,7 +1850,7 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
|
|||
{
|
||||
auto& graphic = gr_ref.second;
|
||||
|
||||
for( auto& seg : graphic.elements )
|
||||
for( auto& seg : *graphic.elements )
|
||||
{
|
||||
PCB_LAYER_ID layer = Dwgs_User;
|
||||
|
||||
|
@ -2526,7 +2526,7 @@ bool FABMASTER::loadGraphics( BOARD* aBoard )
|
|||
else
|
||||
layer = Cmts_User;
|
||||
|
||||
for( auto& seg : geom.elements )
|
||||
for( auto& seg : *geom.elements )
|
||||
{
|
||||
switch( seg->shape )
|
||||
{
|
||||
|
|
|
@ -370,7 +370,7 @@ private:
|
|||
std::string refdes; ///<! REFDES
|
||||
int id; ///<! RECORD_TAG[0]
|
||||
|
||||
graphic_element elements;
|
||||
std::unique_ptr<graphic_element> elements;
|
||||
|
||||
struct BY_ID
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue