"Fossies" - the Fresh Open Source Software Archive

Member "RPerl-5.002000/lib/RPerl/Test/Operator10NamedUnaryExists/program_20_good.cpp.CPPOPS_CPPTYPES" (29 Nov 2019, 1226 Bytes) of package /linux/misc/RPerl-5.002000.tar.gz:


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 //!/usr/bin/env rperl
    2 
    3 
    4 
    5 
    6 
    7 
    8 // [[[ HEADER ]]]
    9 #include <rperlstandalone.h>
   10 #ifndef __CPP__INCLUDED__RPerl__Test__Operator10NamedUnaryExists__program_20_good_cpp
   11 #define __CPP__INCLUDED__RPerl__Test__Operator10NamedUnaryExists__program_20_good_cpp 0.001_000
   12 # ifdef __CPP__TYPES
   13 
   14 
   15 int main() {
   16     // [[[ OPERATIONS HEADER ]]]
   17 
   18 // [[[ OPERATIONS ]]]
   19     integer_arrayref_hashref foo = { {"key_0", {0, 1, 2, 3, 4}}, {"key_1", {5, 6, 7, 8, 9}}, {"key_2", {0, -1, -2, -3, -4}}, {"key_3", {-5, -6, -7, -8, -9}} };
   20     boolean key_does_exist = exists(foo, ((const string) "key_0"));
   21     boolean key_does_not_exist = exists(foo, ((const string) "key_X"));
   22     if ( key_does_exist ) {
   23         print "have $key_does_exist = TRUE" << endl;
   24     }
   25     else {
   26         print "have $key_does_exist = FALSE" << endl;
   27     }
   28     if ( key_does_not_exist ) {
   29         print "have $key_does_not_exist = TRUE" << endl;
   30     }
   31     else {
   32         print "have $key_does_not_exist = FALSE" << endl;
   33     }
   34 
   35 
   36 
   37 
   38 
   39     // [[[ OPERATIONS FOOTER ]]]
   40     return 0;
   41 }
   42 
   43 // [[[ FOOTER ]]]
   44 # elif defined __PERL__TYPES
   45 Purposefully_die_from_a_compile-time_error,_due_to____PERL__TYPES_being_defined.__We_need_to_define_only___CPP__TYPES_in_this_file!
   46 # endif
   47 #endif