THRIFT-2471 Make cpp.ref annotation language agnostic
Client: compiler general
Patch: Dave Watson

This closes #113

commit 52b99af4ee1574253dcb77933d76a7ebb2d830df
 Author: Dave Watson <davejwatson@fb.com>
 Date: 2014-04-23T20:05:56Z

change cpp.ref to &

commit 3f9d31cc6140367529fd8f7b1b67056ec321786f
 Author: Dave Watson <davejwatson@fb.com>
 Date: 2014-04-23T21:50:29Z

Recursion depth limit

commit 61468e4534ce9e6a4f4f643bfd00542d13600d83
 Author: Dave Watson <davejwatson@fb.com>
 Date: 2014-04-25T19:59:18Z

shared_ptr for reference type
diff --git a/lib/cpp/test/RecursiveTest.cpp b/lib/cpp/test/RecursiveTest.cpp
index 00610c6..24c0f7c 100644
--- a/lib/cpp/test/RecursiveTest.cpp
+++ b/lib/cpp/test/RecursiveTest.cpp
@@ -44,7 +44,7 @@
   assert(tree == result);
 
   RecList l;
-  RecList* l2(new RecList);
+  boost::shared_ptr<RecList> l2(new RecList);
   l.nextitem = l2;
 
   l.write(prot.get());
@@ -55,7 +55,7 @@
   assert(resultlist.nextitem->nextitem == NULL);
 
   CoRec c;
-  CoRec2* r(new CoRec2);
+  boost::shared_ptr<CoRec2> r(new CoRec2);
   c.other = r;
 
   c.write(prot.get());
@@ -64,4 +64,12 @@
   assert(c.other != NULL);
   assert(c.other->other.other == NULL);
 
+  boost::shared_ptr<RecList> depthLimit(new RecList);
+  depthLimit->nextitem = depthLimit;
+  try {
+    depthLimit->write(prot.get());
+    assert(false);
+  } catch (const apache::thrift::protocol::TProtocolException& e) {
+  }
+
 }