"Fossies" - the Fresh Open Source Software Archive

Member "glibmm-2.74.0/tools/conf_tests/allows_static_inline_npos.cc" (19 Sep 2022, 649 Bytes) of package /linux/misc/glibmm-2.74.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Configuration-time test program, used in Meson build.
    2 // Check whether a static member variable may be initialized inline to std::string::npos.
    3 // The MipsPro (IRIX) compiler does not like this.
    4 // Corresponds to the M4 macro GLIBMM_CXX_ALLOWS_STATIC_INLINE_NPOS.
    5 
    6 #include <string>
    7 #include <iostream>
    8 
    9 class ustringtest
   10 {
   11 public:
   12   // The MipsPro compiler (IRIX) says "The indicated constant value is not known",
   13   // so we need to initialize the static member data elsewhere.
   14   static const std::string::size_type ustringnpos = std::string::npos;
   15 };
   16 
   17 int main()
   18 {
   19   std::cout << "npos=" << ustringtest::ustringnpos << std::endl;
   20   return 0;
   21 }