Inside of a class template having parameter `typename T` the compiler generates an error concerning 2 functions. `T` does not seem to be recongnized as the template class parameter it was declared as. template <class Return, class ...Args> void executeOnAll(Return (T::*function) (Args &&...), Args &&...args) { for(T &s : *this) (s.*function) (std::forward<Args>(args)...); } template <class Return, class ...Args> void executeOnAll(Return (T::*function) (Args &&...) const, Args &&...args) const { for(const T &s : *this) (s.*function) (std::forward<Args>(args)...); } As my array class has many other member functions, this error is specific to the 2 above. Error Output: c:\appprojects\js3d\source\jscommon\msvc\../jarray.h(244) : error C2825: 'T': …

Member Avatar
Member Avatar
+0 forum 2

In below code snippet , I am trying to add the intefeger and float values in Array template but was surprised to see below output for float value as 5.1 was expected there but getting 0 . Can anybody let me know what can be wrong here. output value=5 value=15 size=10 value=0 value=5.2 size=3 value=5 value=15 size=10 value=0 // It should have print the 5.1 here instead of 0 value=5.2 size=3 code snippet: #include <iostream> using namespace std; template <typename T , int buffer> class Array { T array [buffer]; public: void setval(T x,int index ) { array[index]=x; } T …

Member Avatar
Member Avatar
+0 forum 2

This is a continuation of our basic tutorial on MVC Framework. In this section, we will be creating the template files for both the TBS and the Smarty template engines. **The recap** In [part one](http://www.daniweb.com/web-development/php/tutorials/476695/part-one-php-mvc-framework-understanding-the-basics), we have created application controllers, models, and the one and only lone View class. Once again, please allow me to present few segments of those Classes here. **Main Controller** We will use this as our example. All of our application controllers have the method called index(). If we can recall from part one, we made the parent controller as an abstract class with an abstract …

Member Avatar
Member Avatar
+3 forum 9

I have a form on footer that display on all pages. I want the form not display when I click on contact us button in menu and there should be no form on footer at that page, any help from web developers. Regards

Member Avatar
Member Avatar
+0 forum 1

**Bold Text Here**I am trying to make a generic linked list . below is the code for linkedlist . #ifndef GenericLinkedList_h #define GenericLinkedList_h #include <iostream> #include "GenericLinkNode.h" //class GenericLinkedList; template <typename T> class GenericLinkedList { private : GenericLinkNode<T> *head; public: GenericLinkedList(); void traverse(); bool isEmpty() { return head == NULL ;} void addAtFront(T itemToAdd); void removeAtFront(); }; //class method definitions template <typename T> GenericLinkedList<T>::GenericLinkedList() { head = NULL; } template <typename T> void GenericLinkedList<T>::traverse() { if (isEmpty()) //return if the list is empty return ; GenericLinkNode<T>* currentNode = head; while(currentNode != NULL) { std::cout<<currentNode->key<<std::endl; currentNode = currentNode->next; } } template …

Member Avatar
+0 forum 0

Hi Guys, Does anyone know if we can have template within another template using mustache js ? If yes, can you please provide details how to do it? Or any other alternative if it cannot be done? I have a block of html code which I want to make it as template to repeat the sequence. Inside this block there is another sequence. Can I make that also as template? Thanks! VenusCrystal

Member Avatar
Member Avatar
+0 forum 1

One of my websites is based off of the HTML5 Big Picture Template: [iamepic.today](http://www.iamepic.today) Within this design, I am noticing two interesting effects taking place, one within Internet Explorer 11 and the Other Being Safari 5.1.7. Within Internet Explorer 11, when you scroll through the different sections from top to bottom you will see a weird flickering effect. (This definitely occurs when you scroll fast.) I've read in articles that the -webkit-backface-visibility needs to be set to hidden, but that didn't solve the problem for me. I've also read that it could be a performance issue with that specific version …

Member Avatar
Member Avatar
+0 forum 1

Hello, So I'm having trouble figuring out what the correct syntax is for a function with a return type that is a template type and is within a namespace. Anyone see anything wrong with the code below? -------.HPP file: #pragma once #ifndef EC_UTIL_H #define EC_UTIL_H #include "../CommonHeaders.hpp" #include "../core/common/APVertex.hpp" #include <QString> class QWidget; namespace EditorCommon { template <class T> T *findAndAssert(QString id, QWidget *root); } #endif #include "ECUtil.hpp" ------------------- .CPP file: #include <QApplication> #include <QWidget> #include <QMessageBox> namespace EditorCommon { template <class T> T *findAndAssert(QString id, QWidget *root) { T *w = root->findChild<T *>(id); if(!w) { QMessageBox::critical(root , QString("Critical Application …

Member Avatar
Member Avatar
+0 forum 1

First, i'd like to show you my directories --themes -- images -img1.jpg -index.php -index.php My index.php (root) : <?php require_once '/themes/index.php'; ?> And, the index.php in the template : <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <img src="images/img1.jpg"> </body> </html> I think it will load themes>>images>>img1.jpg But, it loads images>>img1.jpg which not exists. So, I use the dirname `<img src="<?php echo __DIR__ . '/';?>images/img1.jpg">` But, instead of localhost, it use the C: directory which is forbidden Can you tell me how to solve the problem ?

Member Avatar
Member Avatar
+0 forum 2

Hello programmers! I have been working on STL algorithms for some time now as a beginner, and I started doing an exercise, among which is the task of `use the fill algorithm to fill the entire array of strings named items with "hello"`. My code for this is below: // Various statements in exercise in using STL Algorithms #include <iostream> #include <algorithm> #include <iterator> #include <array> using namespace std; int main() { //various statements in using STL algorithms ostream_iterator<int> output(cout," "); //iterator const size_t SIZE=10; array<string,SIZE> myStrings; //array of empty strings fill(myStrings.begin(),myStrings.end(),"hello"); //using the fill algorithm to fill the entire …

Member Avatar
Member Avatar
+0 forum 6

Hello programmers! After covering the basics of STL, I decided to complete the following assignment: `Write a function template palindrome that takes a vector parameter and returns true or false according to whether the vector does or does not read the same forward a backward.` So, for example, a vector with "1,2,3,2,1" would be a palindrome, but a vector containing "1,2,3,4" is not. I accidentially found out that you could do this [on StackOverFlow], template <typename T> bool isPalindrome(const T& theRef) { //solution found on the internet //check to see if theRef's contents is a palindrome return equal(theRef.cbegin(),theRef.cend(),theRef.crbegin()); } but …

Member Avatar
Member Avatar
+0 forum 1

I have created my own template and am able to list all the posts on the index page. I want to be able to have some space after each post. Like a blank height of 5px. I created a class in css called blank5 => .blank5 {height:5px;} but it doesn't seem to work. I know I am missing something regarding the while loop. Not sure where to tell it to break the post. My index.php : <div id="theposts"> <?php while(have_posts()):the_post();?> <h2> <a>"><?php the_title()?> </a> </h2> <?php the_content(__('Continue Reading'));?> <div class="blank5"> </div> <?php endwhile;?> </div> Please help. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 1

One of my client still preferred the old style of web design, he operates a law firm, and would prefer template and design like these: http://www.rahmatlim.com/ http://www.wongpartners.com/ More like a fixed size of frame in a website, but all templates I can find for law firms now are big size and modern, any recommendations on similar templates?

Member Avatar
Member Avatar
+0 forum 1

I want please suggest me ho i can display discription properly under logo , it not fully expressed if you see my post, [Click Here](http://www.photobagh.blogspot.com)

Member Avatar
Member Avatar
+0 forum 2

So for my homework i needa write a code that requires me to look up on a T key and adding stuff to T values. Could someone help me plz? (ie can i set both the key and value to template type) p.s. sorry not being able to expain the question too well! If you don't understand what i mean u can hv a look at the question: In this question, you are required to implement a template class for a container data structure that supports hashing. It should satisfy the following requirements. a. The complete implementation (including the class …

Member Avatar
Member Avatar
+0 forum 2

i have downloaded a number of web page templates and i want to use one or more of them in netbeans. ho do i go about this. do i have to replace the already existing index.html file in my project with the one i downloaded, or where do i copy/import the files of the templates so that i can edit them in netbeans.

Member Avatar
Member Avatar
+0 forum 1

Hi masters I'm new to Google blog So i just want some instruction regarding blog managing Help me out Thank you

Member Avatar
Member Avatar
+0 forum 3

hi my name is vishal. i have been trying long to figure out to export data from vb6 using join queries in sql to ms word. here is my sample code i have tried: Option Explicit Dim dIsVisible As Boolean Dim inst As String Private Declare Function ShellExecute Lib "shell32.dll" Alias _ String, ByVal lpszFile As String, ByVal lpszParams As String, _ ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long **Private Declare Function GetDesktopWindow Lib "user32" () As Long Const SW_SHOWNORMAL = 1 Const SE_ERR_FNF = 2& Const SE_ERR_PNF = 3& Const SE_ERR_ACCESSDENIED = 5& Const SE_ERR_OOM = …

Member Avatar
Member Avatar
+0 forum 1

Hi, Getting some strange behaviour when using Interop to create a Word document from a template. I'm using word to generate a nicely formatted and printable Receipt from Sage 200 based on a Word Template. The code should open Word then create a new document based on the template I have created with bookmarks to populate with the receipt data. The issue is that instead of seeing a single document, I see about 5-6 documents appearing! One of the documents is based on the template I want and the rest are all blank. Also, the document based on the template …

Member Avatar
Member Avatar
+0 forum 3

This is for anyone who might find it helpful. This template... * uses double-buffering, which can help game-makers fix that glitchy screen problem * can be exported as a runnable jar file. If you're like me and had trouble making your Applet executable, this is a possible fix. * Additionally it resizes the interior of the frame, not the frame itself * is easily customizable. Take out or add in whatever you need to make it work, it's all yours package applet; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.Timer; @SuppressWarnings("serial") public class quasiApplet …

Member Avatar
Member Avatar
+0 forum 2

Hello, what is tpl extension file and what is it for ? I once open a php web script and saw *.tpl extension there. Thanks before.

Member Avatar
Member Avatar
+0 forum 1

I have two containers with the type of *A* A<string, double> s1; A<string, bool> s2; So I wrote the *A* class with the necessary functions and I used a template<class T, class E> for it. It has a function that returns a value of *E*, in my case, it returns a double which I'm trying to compare to another double. I'm supposed to overload the < operator for that, but I have no idea how to do that. 4.5 < s1.at("a"); s1.at("a"); returns 1.5, so it's false. I need it to return true. I thought since they are both double …

Member Avatar
Member Avatar
+0 forum 1

Hey folks I've finally figured out how in WPF to template all my buttons so they all behave they way I want. Basically, I want all my buttons, when clicked, to drop down and to the right a few pixels then pop back up. The problem is, I can't set the image on the buttons. I created this in Blend, but I can only seem to set the image inside Blend causing all the buttons to have the same image. <Application x:Class="Application" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="Splash.xaml"> <Application.Resources> <!-- Resources scoped at the Application level should be defined here. --> <Style TargetType="{x:Type …

Member Avatar
Member Avatar
+0 forum 1

i have started learning joomla and now my team leader say me to covert html temlapte to joomla temlate any one have idea about that how can i achive this thanx in advance

Member Avatar
Member Avatar
+0 forum 2

Using Handlebars.js, I am trying to hide the first element in an array. It would be conditional to an option being true/false. Can this be done without a helper? Thanks Horizontal Menu with > as separator {{#if options.display-home}} <li class="home">{{options.home}}</li> {{/if}} /*If display-home true hide initial separator*/ {{#recursive data "menu-breadCrumb"}} {{#if Active}} {{#if ../../block.Options.DisplaySeparator}} <li class="separator">{{../../../block.Options.Separator}}}</li> {{/if}} {{/recursive}}

Member Avatar
Member Avatar
+0 forum 1

The function i am writing below is made to time how long it takes to process a function. // return type for func(pointer to func)(parameters for func), container eg.vector clock_t timeFuction(double(*f)(vector<double>), vector<double> v) { auto start = clock(); f(v); return clock() - start; } This is the function i want to test in my timeFunction. template<typename T> double standardDeviation(T v) { auto tempMean = mean(v); //declared else where double sq_sum = inner_product(v.begin(), v.end(), v.begin(), 0.0); double stdev = sqrt(sq_sum / v.size() - tempMean * tempMean); return stdev; } standardDiviation was made with a template so it can accept any c++ …

Member Avatar
Member Avatar
+0 forum 2

build link error 1>------ Build started: Project: Circular_Link_List, Configuration: Debug x64 ------ 1>Build started 12/30/2012 11:36:28 AM. 1>PrepareForBuild: 1> Creating directory "C:\Users\RIJIN\documents\visual studio 2010\Projects\Circular_Link_List\x64\Debug\". 1>InitializeBuildStatus: 1> Creating "x64\Debug\Circular_Link_List.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1> main.cpp 1> ListNode.cpp 1> Circular_Linklist.cpp 1> Generating Code... 1>main.obj : error LNK2019: unresolved external symbol "public: class ListNode<int> * __cdecl CircularLinkedList<int>::find(int)" (?find@?$CircularLinkedList@H@@QEAAPEAV?$ListNode@H@@H@Z) referenced in function main 1>main.obj : error LNK2019: unresolved external symbol "public: void __cdecl CircularLinkedList<int>::remove(int)" (?remove@?$CircularLinkedList@H@@QEAAXH@Z) referenced in function main 1>main.obj : error LNK2019: unresolved external symbol "public: int __cdecl CircularLinkedList<int>::size(void)" (?size@?$CircularLinkedList@H@@QEAAHXZ) referenced in function main 1>main.obj : error LNK2019: unresolved external symbol "public: …

Member Avatar
Member Avatar
+0 forum 11

Hi I still learning how Smarty templates works. I can't seem to make the image appear on the Smarty Template. I try to used this `{html_image}` it doesn't work. I used `<img>` instead. <img src="images/{$book->image[tbl]}" width="115"> These are my files. This is my **index.php** <?php require("libs/Smarty.class.php"); require_once("get_data.php"); require_once("books.php"); $book = new n_books(); $smarty = new Smarty(); $smarty->assign("book",$book); $output = $smarty->fetch('index.tpl'); $smarty->display('index.tpl'); ?> This is my **index.tpl** <html> <head> <title> Book Sale </title> </head> <body> <table border="0" width="100%"> <tr> <td> <h1> Book Sale</h1> </td> </tr> </table> <table border="1" width="50%"> {section name=tbl loop=$book->title} <tr> <td align="left"> <table> <tr> <td> <img src="images/{$book->image[tbl]}" width="115"> …

Member Avatar
Member Avatar
+9 forum 7

Hi All, not the usual, "how can you help me" thread, but a heads-up on a templating engine I've been using for a while called RainTPL. A few users have posted threads of late asking about templates. I thought I'd give this one a plug, especially as Federico (the author) has just published a speed test page on his site: [url]http://www.raintpl.com/PHP-Template-Engines-Speed-Test/[/url] If you've used templaters like Smarty, RainTPL should seem very simple to use - just "8 tags and 2 methods". If you're interested, I've documented a multilingual implementation at [URL="http://diafol.org/rain.php"]diafol.org/rain.php[/URL], which is itself built on RainTPL. Anybody have any …

Member Avatar
Member Avatar
+0 forum 18

There is an unresolved external symbol in main.cpp when i try to call the insert function. I can’t find the reason why this is happening? Any help is appreciated. main.cpp #include "List.h" int main() { LList<int> number; number.Insert(1); } list.h #include <iostream> using namespace std; template <class T> class LList { private: struct Node { T value; struct Node *next; }; Node *head; public: LList() {head = NULL;} void Insert(T); void Delete(T); void Display(); }; list.cpp #include "List.h" template <class T> void LList<T>::Insert(T temp) { Node *newNode; Node *nodePtr; newNode = new Node; newNode->value = temp; newNode->next = NULL; if(!head) …

Member Avatar
Member Avatar
+0 forum 1

The End.