PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my alerts
my settings
my profile
Don't like ads?
PRO users
don't see any ads ;-)
Public Pastes
Untitled
1 sec ago
Untitled
2 sec ago
Untitled
7 sec ago
Untitled
11 sec ago
Untitled
13 sec ago
Untitled
13 sec ago
Guerilla fights :D
HTML | 23 sec ago
Untitled
31 sec ago
List.cpp
By:
anonymous_infoholic
on
Apr 18th, 2012
| syntax:
C++
| size: 0.19 KB | hits: 38 | expires: Never
download
|
raw
|
embed
|
report abuse
|
print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
#include <iostream>
#include "List.h"
template
<
typename
T
>
void
List
::
Add
(
const
T
&
el
)
{
Node
*
head
=
new
Node
(
el
)
;
if
(
Compare
(
el,i
)
>
i
)
std
::
cout
<<
"Ok"
<<
std
::
endl
;
}
create a
new version
of this paste
RAW Paste Data
#include <iostream> #include "List.h" template<typename T> void List::Add(const T& el) { Node* head = new Node(el); if ( Compare(el,i) > i ) std::cout << "Ok" << std::endl; }