Changeset 3733643


Ignore:
Timestamp:
Sep 13, 2024, 8:29:50 AM (4 weeks ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
9739c56f, dcfcf368
Parents:
2ac78a1
Message:

multiple changes to reflect updates in Cforall

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/uC++toCFA/uC++toCFA.tex

    r2ac78a1 r3733643  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sat Apr 13 11:11:39 2024
    14 %% Update Count     : 5969
     13%% Last Modified On : Fri Sep 13 07:48:54 2024
     14%% Update Count     : 5987
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    154154\begin{tabular}{@{}l|l@{}}
    155155\multicolumn{2}{@{}l}{\lstinline{       int x = 1, y = 2, * p1x = &x, * p1y = &y, ** p2i = &p1x,}} \\
    156 \multicolumn{2}{@{}l}{\lstinline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ && r1x = x, & r1y = y, && r2i = r1x;}} \\
     156\multicolumn{2}{@{}l}{\lstinline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ & r1x = x, & r1y = y, && r2i = r1x;}} \\
    157157\begin{uC++}
    158158**p2i = 3;
     
    384384\multicolumn{2}{@{}l@{}}{\lstinline{string s1, s2;}} \\
    385385\begin{uC++}
    386 s1 = "hi";
     386s1 = "abcdefg";
    387387s2 = s1;
    388388s1 += s2;
     
    393393s1.substr( 2 ); s1.substr( 2, 3 );
    394394s1.replace( 2, 5, s2 );
    395 s1.find( s2 ), s1.rfind( s2 );
     395s1.find( s2 ); s1.rfind( s2 );
    396396s1.find_first_of( s2 ); s1.find_last_of( s2 );
    397 s1.find_first_not_of(s2 ); s1.find_last_not_of( s2 );
     397s1.find_first_not_of( s2 ); s1.find_last_not_of( s2 );
    398398getline( cin, s1 );
    399399cout << s1 << endl;
     
    401401&
    402402\begin{cfa}
    403 s1 = "hi";
     403s1 = "abcdefg";
    404404s2 = s1;
    405405s1 += s2;
     
    409409s1[3];
    410410s1( 2 ); s1( 2, 3 );
    411 //s1.replace( 2, 5, s2 );
    412 find( s1, s2 ), rfind( s1, s2 );
    413 find_first_of( .substr, s2 ); s1.find_last_of( s2 );
    414 s1.find_first_not_of(s2 ); s1.find_last_not_of( s2 );
     411// replace( s1, 2, 5, s2 );
     412// find( s1, s2 ), rfind( s1, s2 );
     413// find_first_of( s2 ); find_last_of( s2 );
     414// find_first_not_of( s1, s2 ); find_last_not_of( s1, s2 );
    415415sin | getline( s1 );
    416416sout | s1;
     
    451451
    452452
    453 \section{\texorpdfstring{\lstinline{uNoCtor}}{uNoCtor}}
     453\section{\texorpdfstring{\lstinline{uArray}}{uArray}}
    454454
    455455\begin{cquote}
    456456\begin{tabular}{@{}l|l@{}}
    457457\begin{uC++}
    458 
     458#include <iostream>
     459using namespace std;
    459460struct S {
    460461        int i;
     
    464465int main() {
    465466        enum { N = 5 };
    466         @uNoCtor<S>@ s[N];   // no constructor calls
    467         for ( int i = 0; i < N; i += 1 ) @s[i].ctor( i )@;
     467        @uArray( S, s, N );@   // no constructor calls
     468        for ( int i = 0; i < N; i += 1 ) @s[i]( i )@; // constructor calls
    468469        for ( int i = 0; i < N; i += 1 ) cout << s[i]@->@i << endl;
    469470}
     
    471472&
    472473\begin{cfa}
    473 #include @<raii.hfa>@          // uninit
     474#include <fstream.hfa>
     475#include <array.hfa>
    474476struct S {
    475477        int i;
     
    479481int main() {
    480482        enum { N = 5 };
    481         @uninit(S)@ s[N];  // no constructor calls
    482         for ( i; N ) @s[i]{ i }@;
     483        @array( S, N ) s = { delay_init };@ // no constructor calls
     484        for ( i; N ) @s[i]{ i }@; // constructor calls
    483485        for ( i; N ) sout | s[i]@.@i;
    484486}
     
    522524\end{cfa}
    523525\\
    524 \multicolumn{2}{l}{\lstinline{C c;}}
     526\multicolumn{2}{@{}l@{}}{\lstinline{C c;}}
    525527\end{tabular}
    526528\end{cquote}
     
    594596\end{cfa}
    595597\\
    596 \multicolumn{2}{l}{\lstinline{M m;}}
     598\multicolumn{2}{@{}l@{}}{\lstinline{M m;}}
    597599\end{tabular}
    598600\end{cquote}
     
    625627\end{cfa}
    626628\\
    627 \multicolumn{2}{l}{\lstinline{T t; // start thread in main routine}}
     629\multicolumn{2}{@{}l@{}}{\lstinline{T t; // start thread in main routine}}
    628630\end{tabular}
    629631\end{cquote}
Note: See TracChangeset for help on using the changeset viewer.