P nedir::*********** *Boost yani iddia.dosya hes? | Netgez.com
SORU
19 Kasım 2014, ÇARŞAMBA


P nedir::*********** *Boost yani iddia.dosya hes?

boost/mpl/assert.hpp, böyle bir şey gördüm:

template<class Pred>
struct eval_assert {
    typedef typename extract_assert_pred<Pred>::type P;
    typedef typename P::type p_type;
    typedef typename ::boost::mpl::if_c<p_type::value,
        AUX778076_ASSERT_ARG(assert<false>),
        failed ************ P::************
    >::type type;
};

************ yapı işaretçileri olarak kabul edilebilecek ilk başarısız olursa, P::************ gerçekten bana hiç mantıklı gelmiyor. Bu standart C ?

CEVAP
19 Kasım 2014, ÇARŞAMBA


Bu kod noktası derleyici "" hata iletileri. görünür üretmesine yardımcı olur

Öncesi static_assert dönem, ÅŸablon-ağır bir kodu derlemek bile kolayca tek bir hata için hata iletileri ~100 çizgiler üretmek olabilir, ve bu satırları ™'u genellikle anlamsızdır.

10 işaretçiler hile, örneğin: gerçek bir hata işaret için kullanışlıdır

 BOOST_STATIC_ASSERT((std::is_same<T,U>));

T=void* U=char* gcc ile derlenmiş ~10 hata çizgiler üretir, ama kolayca ilgili bir görebilirsiniz:

error: no matching function for call to ‘assertion_failed(mpl_::failed************ std::is_same<void*, char*>::************)’

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VÄ°DEO

Rastgele Yazarlar

  • Modus Recordings

    Modus Record

    26 Kasım 2008
  • nigahiga

    nigahiga

    21 Temmuz 2006
  • Photoshop Training Channel

    Photoshop Tr

    13 Temmuz 2012