[QUESTION] MSVC: INTERNAL COMPILER ERROR in combiation with boost::container and boost::movelib::unique_ptr
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Review the attached SkinTimer.cpp and SkinTimerManager.cpp files, focusing on CSkinTimerManager::TimerIsRunning and the boost::container::map declaration. Reproduce the MSVC C1001 error with the reported Boost 1.57.0 setup, compare the boost::unordered_map case, and determine whether its use is suitable or what compatibility guidance is needed.
Written by the indexing model from the issue text.
Description
Hi! I hope you won't mid if I ask here but I am having some issues with old version of boost. More precisly it is 1.57.0. In short, I am developer of XBMC 4.0 which is backport of modern Kodi to Original Xbox from 2001 using official XDK which is C++98. Since C++98 is missing lot of modern C++11 features I found that boost has lot of them and I am using them as replacement for stuff like smart pointers, lambdas, container algorithms etc.
Problem which I am facing is related to unique_ptr. Kodi is using lot of std::unique_ptr which ofcourse is not available in C++98, so as replacement I am using boost::movelib::unique_ptr. It's working fine as long as it is not used in std containers like vector, set or map. Because there is no concept of move in C++98, having std::map<std::string, boost::movelib::unique_ptr> as return value of method will cause compiler error:
class 'boost::movelib::unique_ptr<T>' : no copy constructor available or copy constructor is declared 'explicit'
I have read somewhere that using vector, map or set from boost::container should fix that. But unfortunately for me, when I use boost::container::map<std::string, boost::movelib::unique_ptr> I get INTERNAL COMPILER ERROR:
Compiling...
SkinTimerManager.cpp
lib\boost\boost\intrusive\bstree_algorithms.hpp(620) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
However, I've found out using boost::unordered_map won't crash compiler. So I am wondering why and can I use that instead of normal map?
Here is source code of files:
SkinTimer.cpp
SkinTimerManager.cpp
One of method which is failing is CSkinTimerManager::TimerIsRunning:
bool CSkinTimerManager::TimerIsRunning(const std::string& timer) const
{
boost::container::map<std::string, boost::movelib::unique_ptr<CSkinTimer> >::const_iterator iter = m_timers.find(timer);
if (iter != m_timers.end())
{
return iter->second->IsRunning(); <-- this line failes
}
CLog::Log(LOGERROR, "Couldn't find Skin Timer with name: {}", timer);
return false;
}
And sorry again if this is not a place to ask for a help :)
- Dominant language
- HTML
- Stars
- 8.6k
- Forks
- 2k
- Avg merge
- 9h 35m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/boost
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sagemathinc/sagebrush#1683 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
baseballyama/rsvelte#5235 ·
Maintainers usually reply within 1 day
-
lang-core: member access on a component instance reads its internal fields instead of giving nullOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midspiral/LemmaScript#355 · 1 comment ·
Maintainers usually reply within 1 day