Coder Social home page Coder Social logo

Comments (2)

nehaljwani avatar nehaljwani commented on July 18, 2024

If this is a compiler bug, could the project please document the list of supported Intel compilers?

from type_traits.

shubhdev avatar shubhdev commented on July 18, 2024

This seems like a bug in ICC, particularly the expected SFINAE in presence of sizeof(void)doesn't take place which in this case means boost::is_complete<void> breaks.
The below snippet reproduces what's going on. It fails to build on ICC 16, unless the fix is uncommented.

#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/integral_constant.hpp>

#include <iostream>

/*
 From https://github.com/boostorg/type_traits/blob/develop/include/boost/type_traits/is_complete.hpp#L53
*/
template <unsigned N>
struct ok_tag { double d; char c[N]; };

template <class T>
ok_tag<sizeof(T)> check_is_complete(int);
template <class T>
char check_is_complete(...);
template <class T> struct is_complete
      : public boost::integral_constant<bool, ::boost::is_function<typename boost::remove_reference<T>::type>::value || (sizeof(boost::detail::check_is_complete<T>(0)) != sizeof(char))> {};
//  FIX
// template <> struct is_complete<void> : public boost::false_type{};
int main(int argc, char** argv)
{
    std::cout << is_complete<void>::value;
   return 0;
}

A fix (hack?) is to specialize the is_complete metafunction for void.

from type_traits.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.