Example #1
0
void HelloWorld::addNewMember() {
	auto new_pos = line.back()->getPosition();
	new_pos.x -= line.back()->getSpriteFrame()->getOriginalSizeInPixels().width;
	auto new_dir = line.back()->getDirection();
	auto new_anim = RepeatForever::create(Animate::create(Animation::createWithSpriteFrames(prinny_frames_left, 1.0f / 4)));
	auto new_frame = prinny_frames_left.front();
	switch (new_dir) {
	case 0:
		break;
	case 1: new_anim = RepeatForever::create(Animate::create(Animation::createWithSpriteFrames(prinny_frames_right, 1.0f / 4)));
		new_frame = prinny_frames_right.front();
		break;
	case 2: new_anim = RepeatForever::create(Animate::create(Animation::createWithSpriteFrames(prinny_frames_up, 1.0f / 4)));
		new_frame = prinny_frames_up.front();
		break;
	case 3: new_anim = RepeatForever::create(Animate::create(Animation::createWithSpriteFrames(prinny_frames_down, 1.0f / 4)));
		new_frame = prinny_frames_up.front();
		break;
	}
	Member* new_sprite = Member::create(new_frame, new_dir, new_anim);
	line.pushBack(new_sprite);
	background->addChild(new_sprite);
	new_sprite->setPosition(new_pos);

}
Example #2
0
bool
CheckHeapTracer::check(AutoLockForExclusiveAccess& lock)
{
    // The analysis thinks that markRuntime might GC by calling a GC callback.
    JS::AutoSuppressGCAnalysis nogc;
    rt->gc.markRuntime(this, GCRuntime::TraceRuntime, lock);

    while (!stack.empty()) {
        WorkItem item = stack.back();
        if (item.processed) {
            stack.popBack();
        } else {
            parentIndex = stack.length() - 1;
            TraceChildren(this, item.thing);
            stack.back().processed = true;
        }
    }

    if (oom)
        return false;

    if (failures) {
        fprintf(stderr, "Heap check: %zu failure(s) out of %" PRIu32 " pointers checked\n",
                failures, visited.count());
    }
    MOZ_RELEASE_ASSERT(failures == 0);

    return true;
}
Example #3
0
//------------------------------------------------------------------------------
//!
bool
BIH::findElementsInside( const AABBoxf& box, Vector<uint>& dst, InsideFunc inside, void* data ) const
{
   DBG_BLOCK( os_bih, "BIH::findElementsInside(" << box << ")" );
   DBG( print( os_bih.stream(), ">> " ) );

   if( _nodes.empty() )
   {
      return false;
   }

   Vector<uint> stack;

   stack.pushBack( 0 );
   while( !stack.empty() )
   {
      DBG_MSG( os_bih, "Node #" << stack.back() );
      const Node& node = _nodes[stack.back()];
      stack.popBack();

      switch( node.flags() )
      {
         case Node::BIH_NODE_SPLIT_X:
            visitSplitNode( node, box.slabX(), stack );
            break;
         case Node::BIH_NODE_SPLIT_Y:
            visitSplitNode( node, box.slabY(), stack );
            break;
         case Node::BIH_NODE_SPLIT_Z:
            visitSplitNode( node, box.slabZ(), stack );
            break;
         case Node::BIH_NODE_LEAF:
            visitLeafNode( node, _ids, dst, box, inside, data );
            break;
         case Node::BIH_NODE_CLIP_X:
            visitClipNode( node, box.slabX(), stack );
            break;
         case Node::BIH_NODE_CLIP_Y:
            visitClipNode( node, box.slabY(), stack );
            break;
         case Node::BIH_NODE_CLIP_Z:
            visitClipNode( node, box.slabZ(), stack );
            break;
      }
   }

   return !dst.empty();
}
// Coverage lines have this form:
// CN X Y Z T
// where N is the number of the function, T is the total number of instrumented
// BBs, and X,Y,Z, if present, are the indecies of covered BB.
// BB #0, which is the entry block, is not explicitly listed.
bool BlockCoverage::AppendCoverage(std::istream &IN) {
  std::string L;
  while (std::getline(IN, L, '\n')) {
    if (L.empty() || L[0] != 'C')
      continue; // Ignore non-coverage lines.
    std::stringstream SS(L.c_str() + 1);
    size_t FunctionId  = 0;
    SS >> FunctionId;
    Vector<uint32_t> CoveredBlocks;
    while (true) {
      uint32_t BB = 0;
      SS >> BB;
      if (!SS) break;
      CoveredBlocks.push_back(BB);
    }
    if (CoveredBlocks.empty()) return false;
    uint32_t NumBlocks = CoveredBlocks.back();
    CoveredBlocks.pop_back();
    for (auto BB : CoveredBlocks)
      if (BB >= NumBlocks) return false;
    auto It = Functions.find(FunctionId);
    auto &Counters =
        It == Functions.end()
            ? Functions.insert({FunctionId, Vector<uint32_t>(NumBlocks)})
                  .first->second
            : It->second;

    if (Counters.size() != NumBlocks) return false;  // wrong number of blocks.

    Counters[0]++;
    for (auto BB : CoveredBlocks)
      Counters[BB]++;
  }
  return true;
}
Example #5
0
    //@{
    inline void save() { 
      if((int)trail_.back() != env->level) { 
	env->save(this); 
	trail_.add((int)value); 
	trail_.add(env->level); 
      } 
    }
	TAnimationCurve<T>::TAnimationCurve(const Vector<KeyFrame>& keyframes)
		:mKeyframes(keyframes)
	{
#if BS_DEBUG_MODE
		// Ensure keyframes are sorted
		if(keyframes.size() > 0)
		{
			float time = keyframes[0].time;
			for (UINT32 i = 1; i < (UINT32)keyframes.size(); i++)
			{
				assert(keyframes[i].time > time);
				time = keyframes[i].time;
			}
		}
#endif

		if (keyframes.size() > 0)
		{
			mStart = keyframes[0].time;
			mEnd = keyframes.back().time;
		}
		else
		{
			mStart = 0.0f;
			mEnd = 0.0f;
		}

		mLength = mEnd - mStart;
	}
	void SelectionRenderer::update(const SPtr<Camera>& camera)
	{
		Vector<ObjectData> objects;

		const Vector<HSceneObject>& sceneObjects = Selection::instance().getSceneObjects();
		const Map<Renderable*, SceneRenderableData>& renderables = SceneManager::instance().getAllRenderables();

		for (auto& renderable : renderables)
		{
			for (auto& so : sceneObjects)
			{
				if (!so->getActive())
					continue;

				if (renderable.second.sceneObject != so)
					continue;

				if (renderable.first->getMesh().isLoaded())
				{
					objects.push_back(ObjectData());

					ObjectData& newObjData = objects.back();
					newObjData.worldTfrm = so->getWorldTfrm();
					newObjData.mesh = renderable.first->getMesh()->getCore();
				}
			}
		}

		SelectionRendererCore* core = mCore.load(std::memory_order_relaxed);
		gCoreAccessor().queueCommand(std::bind(&SelectionRendererCore::updateData, core, camera->getCore(), objects));
	}
Example #8
0
//------------------------------------------------------------------------------
//!
bool  resolveHost( const char* hostname, Vector<Socket::Endpoint>& dst )
{
#if BASE_SOCKET_USE_BSD || BASE_SOCKET_USE_WINSOCK
   // Prepare request.
   addrinfo  request;
   memset( &request, 0, sizeof(request) );
   request.ai_family = AF_UNSPEC;

   // Retrieve candidates.
   addrinfo* candidates;
   int err = getaddrinfo( hostname, NULL, &request, &candidates );
   if( err != 0 )
   {
      printAPIError( "ERROR - resolveHost() - getaddrinfo() failed" );
      return false;
   }

   for( addrinfo* cur = candidates; cur != NULL; cur = cur->ai_next )
   {
      dst.pushBack( Socket::Endpoint() );
      memcpy( &(dst.back().impl()->_stor), cur->ai_addr, cur->ai_addrlen );
   }

   freeaddrinfo( candidates );
   return true;
#else
   return false;
#endif
}
Example #9
0
void define() {
    SimpleCpcClient::Process m_proc;
    m_proc.m_id = -1;
    m_proc.m_type = "temporary";
    m_proc.m_owner = "atrt";
    m_proc.m_group = "group";
    //m_proc.m_cwd
    //m_proc.m_env
    //proc.m_proc.m_stdout = "log.out";
    //proc.m_proc.m_stderr = "2>&1";
    //proc.m_proc.m_runas = proc.m_host->m_user;
    m_proc.m_ulimit = "c:unlimited";
    if((rand() & 15) >= 0) {
        m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "sleep");
        m_proc.m_path.assign("/bin/sleep");
        m_proc.m_args = "600";
    } else {
        m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test.sh");
        m_proc.m_path.assign("/home/jonas/run/cpcd/test.sh");
        m_proc.m_args = "600";
    }
    g_procs.push_back(m_proc);

    Properties reply;
    if(g_client.define_process(g_procs.back(), reply) != 0) {
        ndbout_c("define %s -> ERR", m_proc.m_name.c_str());
        reply.print();
        ABORT();
    }
    ndbout_c("define %s -> %d", m_proc.m_name.c_str(), m_proc.m_id);
}
Example #10
0
int main() {
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++ i) {
        scanf("%d", a + i);
    }
    m ++;
    Vector sums;
    sums.push_back(std::make_pair(0, std::vector <int>()));
    for (int i = 0; i < n; ++ i) {
        Vector new_sums;
        for (int t = 0; t < 2; ++ t) {
            foreach (iter, sums) {
                new_sums.push_back(*iter);
                if (t) {
                    new_sums.back().first += a[i];
                    new_sums.back().second.push_back(i);
                }
            }
        }
        std::sort(new_sums.begin(), new_sums.end());
        sums.clear();
        foreach (iter, new_sums) {
            if ((int)sums.size() == m) {
                break;
            }
            if (sums.empty() || sums.back().first < iter->first) {
                sums.push_back(*iter);
            }
        }
    }
Example #11
0
  double MVT::loglike(const Vector &mu_siginv_triangle_nu) const {
    const DatasetType &dat(this->dat());
    const ConstVectorView mu(mu_siginv_triangle_nu, 0, dim());
    SpdMatrix siginv(dim());
    Vector::const_iterator it = mu_siginv_triangle_nu.cbegin() + dim();
    siginv.unvectorize(it, true);
    double ldsi = siginv.logdet();
    double nu = mu_siginv_triangle_nu.back();
    double lognu = log(nu);

    const double logpi = 1.1447298858494;
    uint n = dat.size();
    uint d = mu.size();
    double half_npd = .5 * (nu + d);

    double ans = lgamma(half_npd) - lgamma(nu / 2) - .5 * d * (lognu + logpi);
    ans += .5 * ldsi + half_npd * lognu;
    ans *= n;

    for (uint i = 0; i < n; ++i) {
      double delta = siginv.Mdist(mu, dat[i]->value());
      ans -= half_npd * log(nu + delta / nu);
    }

    return ans;
  }
void printstate(Vector<T> &vec){
    for(int i=0; i<vec.size(); i++)
        cout << "[" << i << "," << vec.at(i) << "]";
    printf("\n");
    cout << "back=" << vec.back() << endl;
    printf("size=%d\n",vec.size());
    printf("capacity=%d\n",vec.capacity());
}
Example #13
0
void unregisterDevice(Device* dev) {
	for (u32int i = 0; i < devices.size(); i++) {
		if (devices[i] == dev) {
			devices[i] = devices.back();
			devices.pop();
			return;
		}
	}
}
Example #14
0
big_integer::big_integer(const std::string &s) {
	const ui64 local_base(1000000000);
	const int base_digits = 9;
	Vector a;
	int pos = (s[0] == '-' || s[0] == '+') ? 1 : 0;
	for (int i = s.size() - 1; i >= pos; i -= 9) {
		ui64 x = 0;
		for (int j = std::max(pos, i - base_digits + 1); j <= i; j++)
			x = x * 10 + s[j] - '0';
		a.push_back(x);
	}

	while (a.size() > 0 && !a.back()) {
		a.pop_back();
	}
	if (a.empty()) {
		box = std::shared_ptr<Vector>(new Vector());
		box->push_back(0);
		box->push_back(0);
		return;
	}

	box = std::shared_ptr<Vector>(new Vector());
	while (!a.empty()) {
		ui64 rem = 0;
		for (size_t i = a.size(); i != 0; --i) {
			size_t j = i - 1;
			ui64 cur = a[j] + rem * local_base;
			a[j] = (ui64) (cur / base);
			rem = (ui64) (cur % base);
		}
		box->push_back(rem);
		while (!a.empty() && !a.back()) {
			a.pop_back();
		}
	}
	while (box->size() > 1 && !box->back()) {
		box->pop_back();
	}
	box->push_back(0);
	if (s[0] == '-') {
		*this = -(*this);
	}
}
Example #15
0
void unmap(SimpleVT* vt) {
	for (u32int i = 0; i < mappedVTs.size(); i++) {
		if (mappedVTs[i] == vt) {
			mappedVTs[i] = mappedVTs.back();
			mappedVTs.pop();
			redrawScreen();
			return;
		}
	}
}
Example #16
0
IDataPack * CDataPack::New()
{
  if (sDataPackCache.empty())
    return new CDataPack();

  CDataPack *pack = sDataPackCache.back().take();
  sDataPackCache.pop();
  pack->Initialize();
  return pack;
}
Example #17
0
 // The caller must hold the lock.
 void drop(T item) {
     for (T *p = busy.begin(); p != busy.end(); p++) {
         if (*p == item) {
             *p = busy.back();
             busy.popBack();
             return;
         }
     }
     JS_NOT_REACHED("removeBusy");
 }
 void PCR::initialize_params(){
   set_a(1.0);
   set_b(1.0);
   Vector h = response_histogram();
   Vector b = beta();
   b[0] = 0;
   b.back()=0.001;     // a should not be zero
   for(uint i=1; i<h.size(); ++i)
     b[i] = log(h[i]/h[0]);
   set_beta(b);
 }
Example #19
0
Value parseCommandLineOptions(int argc, const char16_t * wargv[],
		const Function<int (Value &ret, char c, const char *str)> &switchCallback,
		const Function<int (Value &ret, const String &str, int argc, const char * argv[])> &stringCallback) {
	Vector<String> vec; vec.reserve(argc);
	Vector<const char *> argv; argv.reserve(argc);
	for (int i = 0; i < argc; ++ i) {
		vec.push_back(string::toUtf8(wargv[i]));
		argv.push_back(vec.back().c_str());
	}

	return parseCommandLineOptions(argc, argv.data(), switchCallback, stringCallback);
}
Example #20
0
//------------------------------------------------------------------------------
//!
void
BIH::searchElement( uint elem ) const
{
   uint n = 0;
   Vector<uint> stack( _maxDepth );
   Vector<uint> pstack;
   uint stackID = 0;

   printf( "Searching for element: %d\n", elem );

   while( 1 )
   {
      pstack.pushBack(n);
      if( _nodes[n].isInteriorNode() )
      {
         if( _nodes[n].isClipNode() )
         {
            n = _nodes[n].index();
            continue;
         }
         stack[stackID++] = _nodes[n].index()+1;
         n = _nodes[n].index();
      }
      else
      {
         uint numElems = _nodes[n]._numElements;
         uint id       = _nodes[n].index();
         for( uint i = 0; i < numElems; ++i, ++id )
         {
            if( _ids[id] == elem )
            {
               for( uint s = 0; s < pstack.size(); ++s )
               {
                  printf( "NODE: %d type: %d 0: %f 1: %f l: %d r: %d\n",
                     pstack[s],
                     _nodes[pstack[s]]._index & 7,
                     _nodes[pstack[s]]._plane[0],
                     _nodes[pstack[s]]._plane[1],
                     _nodes[pstack[s]].index(),
                     _nodes[pstack[s]].index()+1
                  );
               }
               return;
            }
         }
         n = stack[--stackID];
         while( _nodes[pstack.back()].index()+1 != n )
         {
            pstack.popBack();
         }
      }
   }
}
Example #21
0
void printonscreen (Vector<int> & x)
{
    std::cout << "O tamanho do vetor: " << x.size() << std::endl;
    if(x.size() > 0)
    {
        std::cout << "O primeiro elemento:" << x.front() << std::endl;
        std::cout << "O ultimo elemento:" << x.back() << std::endl;
        
    }    
    if(x.size() > 3)
        std::cout << "O terceiro elemento:" << x[2] <<  std::endl;
    std::cout << "\n";
}
Example #22
0
void MemoryPatchingMappings::generate(const Vector<DebugSymbol>& prev, const Vector<DebugSymbol>& next)
{
	struct Mapping
	{
		void* from = nullptr;
		void* to = nullptr;
		std::string name;
	};

	// Construct mapping
	std::unordered_map<std::string, Mapping> mapping;
	for (const auto& p: prev) {
		mapping[p.getName()].from = p.getAddress();
	}
	for (const auto& n: next) {
		mapping[n.getName()].to = n.getAddress();
	}

	// Flatten
	Vector<Mapping> flatMap;
	for (auto& kv: mapping) {
		const auto& m = kv.second;
		if (m.from != nullptr && m.from != m.to) {
			flatMap.push_back(m);
			flatMap.back().name = kv.first;
		}
	}
	mapping.clear();

	// Sort by from address
	std::sort(flatMap.begin(), flatMap.end(), [](const Mapping& a, const Mapping& b) -> bool { return a.from < b.from; });

	// Copy to src and dst arrays
	minSrc = reinterpret_cast<void*>(-1);
	maxSrc = nullptr;
	for (const auto& m: flatMap) {
		minSrc = std::min(minSrc, m.from);
		maxSrc = std::max(maxSrc, m.from);
		src.push_back(m.from);
		dst.push_back(m.to);
		name.push_back(m.name);
	}

	std::cout << "Generated " << src.size() << " memory re-mappings. From " << prev.size() << " to " << next.size() << " symbols, on " << minSrc << " to " << maxSrc << " range." << std::endl;
	#ifdef VERBOSE_MAPPING
	for (size_t i = 0; i < src.size(); i++) {
		std::cout << "[" << src[i] << " -> " << dst[i] << "] " << name[i] << "\n";
	}
	#endif
}
Example #23
0
void heapSort(Vector &A)
{
    buildHeap(A);
    Vector temp = A;
    for (int i = A.size() - 1; i >= 0; i--)
    {
        A[i] = temp[0]
        );
        temp[0] = temp.back();
        temp.pop_back();
        maxHeapify(temp, 0);
    }

}
    void PBC::impose(Vector &b)const{
      uint b_sz = b.size();
      assert(b_sz>=2);
      uint M = b_sz-2;
      double dM = M;
      double beta0 = b[0];
      double betaM = b[M];

      double ad0 = M==0 ? 0.0 : beta0 + (beta0 - betaM)/dM;
      if(ad0!=0.0){
        b-= ad0;
        b.back()+=ad0;
      }
    }
Example #25
0
	void append(Expr* in)
	{
		exprs.push_back(in);
		ops.push_back(last_op);
		
		if(start_new_partition)
		{
			partitions.push_back(1);
		}
		else
		{
			partitions.back() += 1;
		}
	}
	String D3D9EmulatedParamBlockParser::parse(const String& gpuProgSource, Vector<D3D9EmulatedParamBlock>& paramBlocks)
	{
		static std::regex paramBlockRegex("BS_PARAM_BLOCK\\s*(.*\\})");
		static std::regex blockNameRegex("([^\\s\\{]*)");
		static std::regex paramNameRegex("(?:\\{ *([^\\, ]*))|(?:\\, *([^\\, \\}]*))");
		static std::regex replaceRegex("BS_PARAM_BLOCK\\s*(.*\\}\\n?)");

		std::sregex_iterator paramBlockIter(gpuProgSource.begin(), gpuProgSource.end(), paramBlockRegex);
		std::sregex_iterator iterEnd;

		while (paramBlockIter != iterEnd)
		{
			std::string stdString = (*paramBlockIter)[1];
			String paramBlockString = String(stdString.begin(), stdString.end());

			paramBlocks.push_back(D3D9EmulatedParamBlock());
			D3D9EmulatedParamBlock& block = paramBlocks.back();

			std::smatch nameMatch;
			if (std::regex_search(paramBlockString, nameMatch, blockNameRegex))
			{
				stdString = nameMatch[1];
				block.blockName = String(stdString.begin(), stdString.end());
			}

			std::sregex_iterator paramNameIter(paramBlockString.begin(), paramBlockString.end(), paramNameRegex);
			while (paramNameIter != iterEnd)
			{
				if((*paramNameIter)[1].matched)
					stdString = (*paramNameIter)[1];
				else
					stdString = (*paramNameIter)[2];

				block.paramNames.push_back(String(stdString.begin(), stdString.end()));
				++paramNameIter;
			}

			++paramBlockIter;
		}

		// Return string without param block definitions
		return std::regex_replace(gpuProgSource, replaceRegex, "");
	}
Example #27
0
		const CharInfo& AddCharInfo(wchar_t t)
		{
			bUpdated = true;
			infoByChar.Add(t, (uint32)infos.size());
			infos.emplace_back();
			CharInfo& ci = infos.back();

			FT_Face* pFace = &face;

			ci.glyphID = FT_Get_Char_Index(*pFace, t);
			if(ci.glyphID == 0)
			{
				pFace = &fallbackFont;
				ci.glyphID = FT_Get_Char_Index(*pFace, t);
			}
			FT_Load_Glyph(*pFace, ci.glyphID, FT_LOAD_DEFAULT);

			if((*pFace)->glyph->format != FT_GLYPH_FORMAT_BITMAP)
			{
				FT_Render_Glyph((*pFace)->glyph, FT_RENDER_MODE_NORMAL);
			}

			ci.topOffset = (*pFace)->glyph->bitmap_top;
			ci.leftOffset = (*pFace)->glyph->bitmap_left;
			ci.advance = (float)(*pFace)->glyph->advance.x / 64.0f;

			Image img = ImageRes::Create(Vector2i((*pFace)->glyph->bitmap.width, (*pFace)->glyph->bitmap.rows));
			Colori* pDst = img->GetBits();
			uint8* pSrc = (*pFace)->glyph->bitmap.buffer;
			uint32 nLen = (*pFace)->glyph->bitmap.width * (*pFace)->glyph->bitmap.rows;
			for(uint32 i = 0; i < nLen; i++)
			{
				pDst[0].w = pSrc[0];
				Reinterpret<VectorBase<uint8, 3>>(pDst[0]) = VectorBase<uint8, 3>(255, 255, 255);
				pSrc++;
				pDst++;
			}
			uint32 nIndex = spriteMap->AddSegment(img);
			ci.coords = spriteMap->GetCoords(nIndex);

			return ci;
		}
Example #28
0
	void ColorGradient::setKeys(const Vector<ColorGradientKey>& keys)
	{
#if BS_DEBUG_MODE
		// Ensure keys are sorted
		if(!keys.empty())
		{
			float time = keys[0].time;
			for (UINT32 i = 1; i < (UINT32)keys.size(); i++)
			{
				assert(keys[i].time >= time);
				time = keys[i].time;
			}
		}
#endif

		if(keys.size() > MAX_KEYS)
		{
			LOGWRN("Number of keys in ColorGradient exceeds the support number (" + 
				toString(MAX_KEYS) + "). Keys will be ignored.");
		}

		if(!keys.empty())
			mDuration = keys.back().time;
		else
			mDuration = 0.0f;


		mNumKeys = 0;
		for(auto& key : keys)
		{
			if(mNumKeys >= MAX_KEYS)
				break;

			mColors[mNumKeys] = key.color.getAsRGBA();
			mTimes[mNumKeys] = Bitwise::unormToUint<16>(key.time / mDuration);

			mNumKeys++;
		}
	}
Example #29
0
TEST(small_vector, Basic) {
  typedef folly::small_vector<int,3,uint32_t
  > Vector;

  Vector a;

  a.push_back(12);
  EXPECT_EQ(a.front(), 12);
  EXPECT_EQ(a.size(), 1);
  a.push_back(13);
  EXPECT_EQ(a.size(), 2);
  EXPECT_EQ(a.front(), 12);
  EXPECT_EQ(a.back(), 13);

  a.emplace(a.end(), 32);
  EXPECT_EQ(a.back(), 32);

  a.emplace(a.begin(), 12);
  EXPECT_EQ(a.front(), 12);
  EXPECT_EQ(a.back(), 32);
  a.erase(a.end() - 1);
  EXPECT_EQ(a.back(), 13);

  a.push_back(12);
  EXPECT_EQ(a.back(), 12);
  a.pop_back();
  EXPECT_EQ(a.back(), 13);

  const int s = 12;
  a.push_back(s); // lvalue reference

  Vector b, c;
  b = a;
  EXPECT_TRUE(b == a);
  c = std::move(b);
  EXPECT_TRUE(c == a);
  EXPECT_TRUE(c != b && b != a);

  EXPECT_GT(c.size(), 0);
  c.resize(1);
  EXPECT_EQ(c.size(), 1);

  Vector intCtor(12);
}
Example #30
0
 KeyInfo * new_option() {
   options.push_back(KeyInfo()); 
   in_option = true; 
   return &options.back();}