"Fossies" - the Fresh Open Source Software Archive

Member "RPerl-5.002000/lib/RPerl/Test/Operator10NamedUnaryExists/program_10_good.cpp.CPPOPS_CPPTYPES" (29 Nov 2019, 1296 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_10_good_cpp
   11 #define __CPP__INCLUDED__RPerl__Test__Operator10NamedUnaryExists__program_10_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     string key_valid = (const string) "key_0";
   21     string key_not_valid = (const string) "key_X";
   22     boolean key_does_exist = exists(foo, key_valid);
   23     boolean key_does_not_exist = exists(foo, key_not_valid);
   24     if ( key_does_exist ) {
   25         print "have $key_does_exist = TRUE" << endl;
   26     }
   27     else {
   28         print "have $key_does_exist = FALSE" << endl;
   29     }
   30     if ( key_does_not_exist ) {
   31         print "have $key_does_not_exist = TRUE" << endl;
   32     }
   33     else {
   34         print "have $key_does_not_exist = FALSE" << endl;
   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