Commit fae11032 authored by Jakub Klinkovský's avatar Jakub Klinkovský

Removed 'using namespace std;' from documentation examples

parent 827a5eab
......@@ -3,7 +3,6 @@
#include <TNL/String.h>
using namespace TNL;
using namespace std;
int main()
{
......@@ -19,5 +18,5 @@ int main()
file >> restoredString;
file.close();
cout << "restored string = " << restoredString <<endl;
std::cout << "restored string = " << restoredString << std::endl;
}
......@@ -3,7 +3,6 @@
#include <cuda.h>
using namespace TNL;
using namespace std;
int main()
{
......@@ -52,6 +51,3 @@ int main()
cudaFree( deviceArray );
delete[] hostArray;
}
......@@ -2,7 +2,6 @@
#include <TNL/File.h>
using namespace TNL;
using namespace std;
int main()
{
......
#include <iostream>
#include <TNL/FileName.h>
using namespace TNL;
using namespace std;
int main()
{
......@@ -33,5 +31,3 @@ int main()
std::cout << fileName.getFileName() << std::endl;
}
}
......@@ -3,7 +3,6 @@
#include <TNL/Containers/StaticVector.h>
using namespace TNL;
using namespace std;
int main()
{
......@@ -30,5 +29,3 @@ int main()
std::cout << fileName.getFileName() << std::endl;
}
}
......@@ -2,7 +2,6 @@
#include <TNL/FileName.h>
using namespace TNL;
using namespace std;
int main()
{
......@@ -27,5 +26,3 @@ int main()
std::cout << fileName.getFileName() << std::endl;
}
}
......@@ -5,7 +5,6 @@
#include <TNL/Devices/Cuda.h>
using namespace TNL;
using namespace std;
template< typename Value,
typename Device >
......@@ -35,16 +34,16 @@ int main()
Object* cudaArrayPtr = &cudaArray;
// Object types
cout << "HostArray type is " << getType< HostArray >() << endl;
cout << "hostArrayPtr type is " << getType( *hostArrayPtr ) << endl;
std::cout << "HostArray type is " << getType< HostArray >() << std::endl;
std::cout << "hostArrayPtr type is " << getType( *hostArrayPtr ) << std::endl;
cout << "CudaArray type is " << getType< CudaArray >() << endl;
cout << "cudaArrayPtr type is " << getType( *cudaArrayPtr ) << endl;
std::cout << "CudaArray type is " << getType< CudaArray >() << std::endl;
std::cout << "cudaArrayPtr type is " << getType( *cudaArrayPtr ) << std::endl;
// Object serialization types
cout << "HostArray serialization type is " << HostArray::getSerializationType() << endl;
cout << "hostArrayPtr serialization type is " << hostArrayPtr->getSerializationTypeVirtual() << endl;
std::cout << "HostArray serialization type is " << HostArray::getSerializationType() << std::endl;
std::cout << "hostArrayPtr serialization type is " << hostArrayPtr->getSerializationTypeVirtual() << std::endl;
cout << "CudaArray serialization type is " << CudaArray::getSerializationType() << endl;
cout << "cudaArrayPtr serialization type is " << cudaArrayPtr->getSerializationTypeVirtual() << endl;
std::cout << "CudaArray serialization type is " << CudaArray::getSerializationType() << std::endl;
std::cout << "cudaArrayPtr serialization type is " << cudaArrayPtr->getSerializationTypeVirtual() << std::endl;
}
......@@ -3,8 +3,7 @@
#include <TNL/String.h>
using namespace TNL;
using namespace std;
int main()
{
Config::ParameterContainer parameters;
......
#include <iostream>
#include <TNL/Object.h>
#include <unistd.h>
using namespace TNL;
using namespace std;
int main()
{
auto parsedObjectType = parseObjectType( String( "MyObject< Value, Device, Index >" ) );
for( auto &token : parsedObjectType )
{
cout << token << endl;
}
std::cout << token << std::endl;
}
......@@ -3,7 +3,6 @@
#include <TNL/File.h>
using namespace TNL;
using namespace std;
int main( int argc, char* argv[] )
{
......@@ -13,37 +12,37 @@ int main( int argc, char* argv[] )
String string3( string2 );
String string4 = convertToString( 28.4 );
cout << "empytString = " << emptyString << endl;
cout << "string1 = " << string1 << endl;
cout << "string2 = " << string2 << endl;
cout << "string3 = " << string3 << endl;
cout << "string4 = " << string4 << endl;
std::cout << "empytString = " << emptyString << std::endl;
std::cout << "string1 = " << string1 << std::endl;
std::cout << "string2 = " << string2 << std::endl;
std::cout << "string3 = " << string3 << std::endl;
std::cout << "string4 = " << string4 << std::endl;
cout << "emptyString size = " << emptyString.getSize() << endl;
cout << "string1 size = " << string1.getSize() << endl;
cout << "string1 length = " << string1.getLength() << endl;
std::cout << "emptyString size = " << emptyString.getSize() << std::endl;
std::cout << "string1 size = " << string1.getSize() << std::endl;
std::cout << "string1 length = " << string1.getLength() << std::endl;
const char* c_string = string1.getString();
cout << "c_string = " << c_string << endl;
std::cout << "c_string = " << c_string << std::endl;
cout << " 3rd letter of string1 =" << string1[ 2 ] << endl;
std::cout << " 3rd letter of string1 =" << string1[ 2 ] << std::endl;
std::cout << " string1 + string2 = " << string1 + string2 << std::endl;
std::cout << " string1 + \" another string\" = " << string1 + " another string" << std::endl;
cout << " string1 + string2 = " << string1 + string2 << endl;
cout << " string1 + \" another string\" = " << string1 + " another string" << endl;
string2 += "another string";
cout << " string2 = " << string2;
std::cout << " string2 = " << string2;
string2 = "string 2";
if( string3 == string2 )
cout << "string3 == string2" << endl;
std::cout << "string3 == string2" << std::endl;
if( string1 != string2 )
cout << "string1 != string2" << endl;
std::cout << "string1 != string2" << std::endl;
if( ! emptyString )
cout << "emptyString is empty" << endl;
std::cout << "emptyString is empty" << std::endl;
if( string1 )
cout << "string1 is not empty" << endl;
std::cout << "string1 is not empty" << std::endl;
File myFile;
myFile.open( "string_save.out", std::ios_base::out );
......@@ -52,5 +51,5 @@ int main( int argc, char* argv[] )
myFile.open( "string_save.out", std::ios_base::in );
myFile >> string3;
cout << "string 3 after loading = " << string3 << endl;
std::cout << "string 3 after loading = " << string3 << std::endl;
}
......@@ -2,10 +2,9 @@
#include <TNL/String.h>
using namespace TNL;
using namespace std;
int main()
{
String str("my world");
cout << "Allocated_size = " << str.getAllocatedSize() << endl;
}
\ No newline at end of file
std::cout << "Allocated_size = " << str.getAllocatedSize() << std::endl;
}
......@@ -2,12 +2,11 @@
#include <TNL/String.h>
using namespace TNL;
using namespace std;
int main()
{
String phrase( "Say yes yes yes!" );
cout << "phrase.replace( \"yes\", \"no\", 1 ) = " << phrase.replace( "yes", "no", 1 ) << endl;
cout << "phrase.replace( \"yes\", \"no\", 2 ) = " << phrase.replace( "yes", "no", 2 ) << endl;
cout << "phrase.replace( \"yes\", \"no\", 3 ) = " << phrase.replace( "yes", "no", 3 ) << endl;
}
\ No newline at end of file
std::cout << "phrase.replace( \"yes\", \"no\", 1 ) = " << phrase.replace( "yes", "no", 1 ) << std::endl;
std::cout << "phrase.replace( \"yes\", \"no\", 2 ) = " << phrase.replace( "yes", "no", 2 ) << std::endl;
std::cout << "phrase.replace( \"yes\", \"no\", 3 ) = " << phrase.replace( "yes", "no", 3 ) << std::endl;
}
......@@ -2,12 +2,11 @@
#include <TNL/String.h>
using namespace TNL;
using namespace std;
int main()
{
String string;
string.setSize( 1024 );
cout << "String size = " << string.getSize() << endl;
cout << "Allocated size = " << string.getAllocatedSize() << endl;
std::cout << "String size = " << string.getSize() << std::endl;
std::cout << "Allocated size = " << string.getAllocatedSize() << std::endl;
}
......@@ -2,17 +2,16 @@
#include <TNL/String.h>
using namespace TNL;
using namespace std;
int main()
{
String dates("3/4/2005;8/7/2011;11/12/2019");
vector< String > list = dates.split(';');
cout << "list_dates = " << list[0] << ", " << list[1] << ", " << list[2] << endl;
std::vector< String > list = dates.split(';');
std::cout << "list_dates = " << list[0] << ", " << list[1] << ", " << list[2] << std::endl;
String cars("Subaru,Mazda,,Skoda," );
vector< String > list3 = cars.split(',', String::SplitSkip::SkipEmpty );
cout << "split with String::SkipEmpty = " << list3[0] << ", " << list3[1] << ", " << list3[2] << endl;
std::vector< String > list3 = cars.split(',', String::SplitSkip::SkipEmpty );
std::cout << "split with String::SkipEmpty = " << list3[0] << ", " << list3[1] << ", " << list3[2] << std::endl;
std::vector<String> list5 = cars.split(',');
cout << "split without String::SkipEmpty = " << list5[0] << ", " << list5[1] << ", " << list5[2] << ", " << list5[3] << endl;
std::cout << "split without String::SkipEmpty = " << list5[0] << ", " << list5[1] << ", " << list5[2] << ", " << list5[3] << std::endl;
}
......@@ -2,12 +2,11 @@
#include <TNL/String.h>
using namespace TNL;
using namespace std;
int main()
{
String names( " Josh Martin John Marley Charles " );
String names2( ".......Josh Martin...John..Marley.Charles..." );
cout << "names strip is: " << names.strip() << endl;
cout << "names2 strip is: " << names.strip( '.' ) << endl;
}
\ No newline at end of file
std::cout << "names strip is: " << names.strip() << std::endl;
std::cout << "names2 strip is: " << names.strip( '.' ) << std::endl;
}
#include <iostream>
#include <TNL/Timer.h>
#include <unistd.h>
using namespace TNL;
using namespace std;
int main()
{
......@@ -12,12 +10,11 @@ int main()
time.start();
usleep(microseconds);
time.stop();
cout << "Elapsed real time: " << time.getRealTime() << endl;
cout << "Elapsed CPU time: " << time.getCPUTime() << endl;
cout << "Elapsed CPU cycles: " << time.getCPUCycles() << endl;
std::cout << "Elapsed real time: " << time.getRealTime() << std::endl;
std::cout << "Elapsed CPU time: " << time.getCPUTime() << std::endl;
std::cout << "Elapsed CPU cycles: " << time.getCPUCycles() << std::endl;
time.reset();
cout << "Real time after reset:" << time.getRealTime() << endl;
cout << "CPU time after reset: " << time.getCPUTime() << endl;
cout << "CPU cycles after reset: " << time.getCPUCycles() << endl;
std::cout << "Real time after reset:" << time.getRealTime() << std::endl;
std::cout << "CPU time after reset: " << time.getCPUTime() << std::endl;
std::cout << "CPU cycles after reset: " << time.getCPUCycles() << std::endl;
}
......@@ -4,7 +4,6 @@
#include <unistd.h>
using namespace TNL;
using namespace std;
int main()
{
......@@ -14,6 +13,6 @@ int main()
usleep(microseconds);
time.stop();
Logger logger( 50,cout );
Logger logger( 50, std::cout );
time.writeLog( logger, 0 );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment